-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
this is probably dup of MONGOID-815 but it is still not working with mongoid 2.3:
ruby-1.9.2-p180 :092 > class TestHashes; include Mongoid::Document; field :atts, :type => Hash; end
=> #<Mongoid::Fields::Serializable::Hash:0x0000000c91e4c8 @name="atts", @options={:type=>Hash}, @label=nil, @localize=nil, @default_val=nil, @cast_on_read=false>
ruby-1.9.2-p180 :093 > TestHashes.create(:atts => {:foo => {}})
ruby-1.9.2-p180 :095 > a = TestHashes.first
=> #<TestHashes _id: 4ea082122c54793154000005, _type: nil, atts: {"foo"=>{}}>
ruby-1.9.2-p180 :096 > a.atts["foo"]["bar"] = 10
=> 10
ruby-1.9.2-p180 :097 > a.save
=> true
ruby-1.9.2-p180 :098 > a.reload.atts
=> {"foo"=>{}}
ruby-1.9.2-p180 :099 > a.atts_will_change!
=> nil
ruby-1.9.2-p180 :100 > a.atts["foo"]["bar"] = 10
=> 10
ruby-1.9.2-p180 :101 > a.changes
=>
ruby-1.9.2-p180 :102 > a._updates
=> {}
ruby-1.9.2-p180 :103 > a.save
=> true
ruby-1.9.2-p180 :104 > a.reload.atts
=> {"foo"=>{}}
ruby-1.9.2-p180 :105 > Mongoid::VERSION => "2.3.1"