I am trying to update an attribute from a record in my Mongo collection, but the new value isn't being saved.
a = GraphEngine::UserPlace.where(place_id:5000000701039).first
a.place_id = 5000000257690
a.save!
=> true
If I inspect a
, the place_id
reflects the new value, 5000000257690
, but when I load the record again, the new place_id does not persist.
Any idea why this is the case? I've checked to make sure that there isn't a duplicate record.
I've also tried a.update_attribute(:place_id,5000000257690)
but no luck either. It returns => true
, but the value does not persist.
Check if place_id is accessible. If not add something like this to the model:
attr_accessible :place_id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With