polymorphic .find_or_create_by on embedded documents?

35 views
Skip to first unread message

Derick Bailey

unread,
May 6, 2011, 4:51:25 PM5/6/11
to Mongoid
Hi,

in previous released (2.0.beta.20), I could pass a class type as the
2nd parameter of the .find_or_create_by block on embedded documents.
this doesn't appear to be the case any more, with v2.0.1, yet I still
need to do polymorphic find_or_create_by. any suggestions / pointers
on how to do this?

I used to do this:

SomeClass.childclass.find_or_create_by({:key => "value"},
InheritingChildClass)

now I get an exception saying too many arguments (2 for 1)
on .find_or_create_by

any help is appreciated.

thanks.

-derick
Reply all
Reply to author
Forward
0 new messages