-
Notifications
You must be signed in to change notification settings - Fork 235
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
Decrease number of deprecation warnings in Ruby 2.7 #496
base: master
Are you sure you want to change the base?
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 |
---|---|---|
|
@@ -28,9 +28,9 @@ def self.controller_path | |
|
||
module Helpers | ||
# Constantizes name if needed, call builders and returns instance. | ||
def cell(name, *args, **kws, &block) # classic Rails fuzzy API. | ||
def cell(name, *args, &block) # classic Rails fuzzy API. | ||
constant = name.is_a?(Class) ? name : class_from_cell_name(name) | ||
constant.(*args, **kws, &block) | ||
constant.(*args, &block) | ||
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. What warning does removing 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 is the warning we got:
I was wondering why it wasn't failing with ruby 3 and figured out that those keyword arguments are not used because the instance method cell helper was passing the option as a positional argument anyways (so the kws hash would always be empty in ruby 3). |
||
end | ||
end | ||
extend Helpers | ||
|
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.
Not sure if this is an appropriate fix, but it seems to work!
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.
Are you guys using Cells' builder features, and if yes, what do your builders look like?
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.
No we are not using them. I just found this by running the tests with ruby 2.7 and the tests still pass for ruby 3 so I think this may work.