Hi,
I have a strange problem with before_save and create.
In my controller I have:
self.current_cart = Cart.create(:user_id => current_user.id, :status =>
CURRENT_CART)
self.current_cart.update_attributes({:order_num => self.current_cart.id +
seed_num })
This works well until I add a before_save in the model:
def before_save
self.is_cached = false
end
Now I get an error in the update_attributes call that
self.current_cart.idis nil. Any idea why this could happen?
Thanks,
Ram
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---