Skip to content
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

Remove unused bitemporal clauses #182

Closed

Conversation

wata727
Copy link
Contributor

@wata727 wata727 commented Dec 10, 2024

The valid_datetime returned by Relation#bitemporal_clause is propagated to child associations and affects the behavior of the bitemporal gem internals, but the valid_from, valid_to ​​do not appear to affect the behavior.

@wata727
Copy link
Contributor Author

wata727 commented Dec 11, 2024

The following spec seems to be failing:

context "with Arel::Nodes::SqlLiteral" do
let(:relation) { Blog.where(Blog.arel_table[:valid_to].gt(Arel::Nodes::SqlLiteral.new(1.days.to_s))) }
it { is_expected.to include(valid_from: be_kind_of(Time), valid_to: nil) }
end

Related commit: 601d966

Reading through this commit, it seems that this change will cause a breaking change to Relation#bitemporal_option. I'm not sure if this is actually useful, but it seems that the spec is that at least bitemporal_option contains valid_from/to that is resolved by ActiveRecord::Realtion.

For the reasons above, I'm going to discard this change. If you're interested, you can bump the major version and merge it.

@wata727 wata727 closed this Dec 11, 2024
@wata727 wata727 deleted the remove_unused_bitemporal_clauses branch December 11, 2024 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant