-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 5.1.1
-
Component/s: None
-
None
-
Environment:Rails 4.2.5.2
gem mongoid-5.1.1
So I have a model like so:
class PlacementData
store_in collection: 'events' , database: 'dev'
field :pid, type: Integer
field :eventData, type: Hash
field :primary, type: Hash
....
end
In rails console, the following was working in Mongoid v3
> PlacementData.where(pid: 1).first.eventData
But after updating mongoid to 5.1.1 I get the following error:
Missing attribute
I managed to dirty mix fix it by creating this method:
def eventData
self.attributes['eventData']
end
but Im quite annoyed I cant call eventData on a placement_data instance like I used to. You guys have any idea what could be wrong?
- related to
-
MONGOID-4296 Regression of using #only and accessing subdocuments via [] accessor
- Closed