Reputation: 1479
I would need to filter the records to include for has_many relation with the params that are passed to the serializer. The object_method_name
option is invoking a method in the model, but how can I pass the params to the method?
Or is there a way to use a Proc for getting the records for has_many relation? Couldn't find any documentation for that at least.
Upvotes: 0
Views: 928
Reputation: 1479
Found it. You can give a block to it
has_many :records do |object, params|
object.my_records(params)
end
Upvotes: 1