-
Notifications
You must be signed in to change notification settings - Fork 43
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
Support Rails 8.0 #152
Support Rails 8.0 #152
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s| | |
|
||
s.required_ruby_version = '>= 2.7.0' | ||
|
||
s.add_dependency 'rails', '~> 7.0' | ||
s.add_dependency 'rails', '~> 8.0' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This means people MUST use Rails 8. We certainly have no intention of upgrading yet given how buggy 7.1 and 7.2 have been for us - it feels like the Rails team is rushing and it's been a very small time between Rails 7 and 8. so we're being very cautious. I think you want something like |
||
|
||
s.add_development_dependency 'debug', '~> 1.9' | ||
s.add_development_dependency 'rake', '~> 13.2' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is Rails 8 making five minute tasks take hours, again. Rails 7 and 8 have felt like the "bad old days" of Rails 2/3/4 era massive changes in APIs and constant dev churn. I can't find many references to frozen-by-default Hashes anywhere inside the higher level Rails 8 changes, yet it's a major change that (as we see here) can cause breakage.
In any case, I've just realised that this code was broken anyway. The "correct" #as_json takes some finding, but the relevant
#as_json
's options includeexcept:
. That's what is being manipulated on line 78.So we now call
super
, without parens so it gets passed any and all parameters including our options. The result is a Hash. We're then calling Hash#except, but that takes the keys to exclude as a list/Array, yet we're providing an options Hash with who-knows-what as the keys. Besides, since the options were already passed in, exclusions already happened.I'd like to contribute some minor changes to your branch to get things working for Rails 7/8 and have CI pass (for which I think I might be forced to concede auto-test for Ruby 3.2 or later only and drop tests for earlier versions, even though they still work perfectly). For example, this change - and there's one other place something similar isn needed, if tests are to pass - becomes, in my preferred variation after trying a few:
Are you able and willing to grant me push permission for the changes, per this reference? TIA!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@terracatta ...ah, yay, it can be done for old Rubies by modifying the Rails constraint by version. It looks like this: #154