-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
I have the following models:
class Temp include Mongoid::Document include Mongoid::Timestamps field :name embeds_one :temp_em accepts_nested_attributes_for :temp_em end class TempEm include Mongoid::Document include Mongoid::Timestamps field :some end
And i want to update or create embedded document(TempEm)
ruby t = Temp.find_or_create_by(:name => 'test') t.update_attributes!(:temp_em_attributes => {:some => 'some name8'}) p t.temp_em t.reload t.temp_em
After first call it works ok. TempEm was created with correct field :some
In second call modify :some to "some other value" and it should be updated but is not.