Railsコンソールでデータの更新を実行しようとしていますが、何らかの理由で、1つの属性を更新すると、Mongoidが他の属性をnullに設定します。
1.9.3p194 :044 > User.first().cart.cartitems
=> [#<Cartitem _id: 5047eef3c8bafa761100001a, _type: nil, quantity: 1000, scentid: 1>]
1.9.3p194 :047 > User.first().cart.cartitems.where(scentid:1).update(quantity:100)
=> nil
1.9.3p194 :048 > User.first().cart.cartitems
=> [#<Cartitem _id: 5047ef65c8bafa761100001c, _type: nil, quantity: 100, scentid: nil>]
scentidがnilに設定されていることに注目してください。.set(:quantity、100)も使用してみましたが、カートアイテムを再度クエリしても、これは持続しません。
これは正常な動作ですか?
ありがとう!