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

Add support for Rails 7.1 #125

Merged
merged 2 commits into from
Nov 21, 2023
Merged

Add support for Rails 7.1 #125

merged 2 commits into from
Nov 21, 2023

Conversation

owst
Copy link
Contributor

@owst owst commented Nov 1, 2023

Require ransack >= 4.1 for Rails 7.1 support.

Two major changes in Rails 7.1 are:

ActiveSupport::Deprecation.behavior = :raise
if ActiveSupport.respond_to?(:deprecator)
ActiveSupport.deprecator.behavior = :raise
ActiveRecord.deprecator.behavior = :raise
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is right, but would appreciate another pair of eyes to check

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super familiar with the changes to deprecations, but this looks good to me. It looks like ActiveRecord.deprecator is a dedicated instance of ActiveSupport::Deprecation.

Require ransack >= 4.1 for Rails 7.1 support.

Two major changes in Rails 7.1 are:
- [NullRelation was removed][null_relation], but it seems the behaviour
  changed in Rails 7.0 such that the special handling was no longer
  required anyway
- [ActiveSupport::Deprecation singleton was deprecated][deprecation]

[null_relation]: rails/rails#47800
[deprecation]: rails/rails#47354
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|

spec.files = Dir.glob('{lib/**/*,*.{md,txt,gemspec}}')

spec.add_dependency 'activerecord', '>= 6.1', '< 7.1'
spec.add_dependency 'activerecord', '>= 6.1', '< 7.2'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @owst, I hope you don't mind, but I set this back to 6.1. Was there a reason you bumped the minimum version to 6.1.6?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @rzane no worries, please modify as you see fit - it was because I thought I read that ransack >= 4.11 (required for Rails 7.1 support) had a lower-bound of 6.1.6 for activerecord, but it seems that it actually requires >= 6.1.5, so I guess baby_squeel should match that lower bound?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @rzane any chance you could take another look at this? What do you think of matching Ransack's activerecord lower bound?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me! Thank you for the explanation!

@rzane rzane merged commit a91bf4e into rzane:master Nov 21, 2023
8 checks passed
@rzane
Copy link
Owner

rzane commented Nov 21, 2023

Sorry for the delay and thanks for contributing @owst. Also, thank you @rocket-turtle. I just released v3.0.0.

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.

2 participants