hyper-mesh icon indicating copy to clipboard operation
hyper-mesh copied to clipboard

Named parameters on scopes don't work

Open sfcgeorge opened this issue 7 years ago • 1 comments

Named parameters on scopes don't seem to be supported by hyper-mesh, it complains about the number of arguments.

# works
scope(:mark_viewed_by, lambda do |user, recruitment|
end)

# errors
scope(:mark_viewed_by, lambda do |user, recruitment:|
end)

This is the error you get from execute_remote with the second option (named params):

HyperModel fetching records failed, exception caught when applying ["mark_viewed_by", 9, {"recruitment"=>10}] to db object #<Message::ActiveRecord_Relation:0x00007f970ff20fc8>: wrong number of arguments (given 2, expected 1)

sfcgeorge avatar Feb 06 '18 11:02 sfcgeorge

yeah that is not surprising... I am not going to tag this for the 1.0 / 15 release. okay?

catmando avatar Feb 06 '18 19:02 catmando