Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mshibuya committed Mar 3, 2021
1 parent 4fe2152 commit 6e8d042
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rails_admin/adapters/active_record/abstract_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def save(options = {validate: true})
object.save(**options)
end

def method_missing(method_name, *args, &block)
object.send(method_name, *args, &block)
def method_missing(method_name, *args, **kwargs, &block)
object.send(method_name, *args, **kwargs, &block)
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
expect(object).to receive(:method_call)
abstract_object.method_call
end

context 'when the method of underlying object receives keyword arguments' do
let(:object) { Class.new{ def foo(bar: 1); end }.new }

it 'does not break on proxying' do
expect { abstract_object.foo(bar: 2) }.not_to raise_error
end
end
end

describe 'create' do
Expand Down

0 comments on commit 6e8d042

Please sign in to comment.