-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Historical objects should not use valid_to
to get associations
#283
Comments
If A1 is valid from |
Examplecountry = Country.create name: 'Country'
city = country.cities.create name: 'City'
ApplicationRecord.transaction do
country.update_column :name, 'Country 2'
city.update_column :name, 'City 2'
end Validity ranges
Expected Result
Actual Result
|
This also happens for deleted associations. |
It seems that datetime precision is not available for the range, and we should assume that the precision is 6. This seems to only be valid in Postgres >= 13 (tsrange uses a timestamp value as subtype) |
valid_to
for queriesvalid_to
for queries
valid_to
for queriesvalid_to
to get associations
so we know. that the validity of an object is an open ended range
[t1,t2)
but if there is something associated to this object, the query that chronomodel does by default is
'2024-04-12 13:41:12.249642'::timestamp <@ history.cities.validity
The text was updated successfully, but these errors were encountered: