On Wed, Sep 21, 2011 at 12:29 AM, elliottg <x...@simplecircle.net> wrote:

> I am getting this error when trying to assign a Cart instance to a
> parent.cart has_one assoc.
>
> ActiveRecord::AssociationTypeMismatch in
> CustomerOrdersController#create
> Cart(#2188120600) expected, got Cart(#2198420140)
>
> I can get it to work in the console but not in my app... I imagine I
> am doing something screwy in the app, but, I'm confused by the
> mismatch error as it says the two class instances are both of the same
> class.
>
> Thoughts?
>

Not sure, but a possibility is that one of the 2 Cart classes is
really MyModule::Cart and the other ::Cart . You may check if
you have defined class Cart in a module. Maybe you then
need to use the fully qualified name ::Cart or MyModule::Cart.

HTH,

Peter

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to