-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
I've created a Rails3 Repo with a rspec-test to illustrate the problem here: https://github.com/QEDio/mongoid_error.
Clone, bundle install, rake.
In short
class Computer
include Mongoid::Document
embeds_many :parts
end
class Part
include Mongoid::Document
embedded_in :computer
field :description1, type: Array
field :description2
end
This fails:
computer = Computer.new
part = Part.new
computer.parts << part
computer.save
part.description1 = PART_DATA1
part.save
part.description1 = PART_DATA2
part.save
==> now part.description1 is null (in the db)