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

Fix keyword args error in Ruby 3 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/best_in_place/display_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ def lookup(klass, attr)
end

def add_model_method(klass, attr, display_as)
model_attributes(klass)[attr.to_s] = Renderer.new method: display_as.to_sym, type: :model
model_attributes(klass)[attr.to_s] = Renderer.new({method: display_as.to_sym, type: :model})
end

def add_helper_method(klass, attr, helper_method, helper_options = nil)
model_attributes(klass)[attr.to_s] = Renderer.new method: helper_method.to_sym, type: :helper, attr: attr, helper_options: helper_options
model_attributes(klass)[attr.to_s] = Renderer.new({method: helper_method.to_sym, type: :helper, attr: attr, helper_options: helper_options})
end

def add_helper_proc(klass, attr, helper_proc)
model_attributes(klass)[attr.to_s] = Renderer.new type: :proc, attr: attr, proc: helper_proc
model_attributes(klass)[attr.to_s] = Renderer.new({type: :proc, attr: attr, proc: helper_proc})
end

def model_attributes(klass)
Expand Down