Custom methods that don't return Plucky::Query for association proxies #404

jch opened this Issue Apr 12, 2012 · 0 comments


None yet
1 participant

jch commented Apr 12, 2012


I defined a custom from_param finder that I've added as a plugin to a model. When trying to access this method on a ManyDocumentsProxy, it correctly sees that the underlying model does respond to from_param, but since the value it returns isn't a Plucky::Query, it continues up the method missing chain. Here is a gist illustrating my example. Is there a recommended approach for tackling this? I thought about wrapping the result in a Plucky::Query, but the result is really meant to be a singular model instance. I also thought about changing the definition of method_missing to return result even if it isn't a Plucky::Query, but that appears to break many tests.

Any thoughts?

@cheald cheald closed this in ffd22e1 Jul 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment