You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a fix that handles SingleAssociation. I looked into fixing ManyAssociation too but I'm not sure it's warranted; Array doesn't make use of keyword args, so it would be awkward to test.
STR:
class Foo
include Dynamoid::Document
belongs_to :bar
end
class Bar
include Dynamoid::Document
def baz(kwarg1:, kwarg2:)
end
end
# load a model
foo = ::Foo.find(foo_key, raise_error: false, consistent_read: true)
# follow a belongs_to association to a related model
bar = foo.bar
# call instance method of related model; will be proxied by Dynamoid::Associations::BelongsTo
bar.baz(kwarg1: 'hi')
Expected outcome: method is proxied faithfully to Bar#baz.
Actual outcome: keyword args are transformed into a hash that is passed as a positional arg
ArgumentError: wrong number of arguments (given 1, expected 0; required keywords: kwarg1, kwarg2)
The text was updated successfully, but these errors were encountered:
xeger
pushed a commit
to xeger/dynamoid
that referenced
this issue
Jul 25, 2022
I have a fix that handles
SingleAssociation
. I looked into fixingManyAssociation
too but I'm not sure it's warranted;Array
doesn't make use of keyword args, so it would be awkward to test.STR:
Expected outcome: method is proxied faithfully to
Bar#baz
.Actual outcome: keyword args are transformed into a hash that is passed as a positional arg
The text was updated successfully, but these errors were encountered: