-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
I have updated mongoid 2.3.4 -> 2.4.0 and got this bug:
class Character include Mongoid::Document embeds_one :stats, :class_name => 'Stats' end class Stats include Mongoid::Document field :directions, :type => Array embedded_in :character end
1.9.3p0 :010 > cc = Character.first.stats => #<Stats _id: 4f071ee09759f7826800001d, _type: nil, directions: nil> 1.9.3p0 :011 > cc.directions = [2, 3, 6, 2] => [2, 3, 6, 2] 1.9.3p0 :012 > cc.save => true 1.9.3p0 :013 > cc => #<Stats _id: 4f071ee09759f7826800001d, _type: nil, directions: [2, 3, 6, 2]> 1.9.3p0 :014 > cc = Character.first.stats => #<Stats _id: 4f071ee09759f7826800001d, _type: nil, directions: nil>
When I went back to mongoid 2.3.4 and repeat these steps, I got expected result:
1.9.3p0 :001 > cc = Character.first.stats => #<Stats _id: 4f071ee09759f7826800001d, _type: nil, directions: nil> 1.9.3p0 :002 > c.directions = [4, 0, 7, 1] => [4, 0, 7, 1] 1.9.3p0 :003 > cc.save => true 1.9.3p0 :004 > cc => #<Stats _id: 4f071ee09759f7826800001d, _type: nil, directions: [4, 0, 7, 1]> 1.9.3p0 :005 > cc = Character.first.stats => #<Stats _id: 4f071ee09759f7826800001d, _type: nil, directions: [4, 0, 7, 1]>