Module: Mongoid::Association::Marshalable
- Included in:
- Proxy
- Defined in:
- lib/mongoid/association/marshalable.rb
Overview
Mixin module for Mongoid::Association::Proxy which adds custom Marshal.dump functionality.
Instance Method Summary collapse
-
#marshal_dump ⇒ Array<Object>
Provides the data needed to Marshal.dump an association proxy.
-
#marshal_load(data) ⇒ Array<Object>
Takes the provided data and sets it back on the proxy.
Instance Method Details
#marshal_dump ⇒ Array<Object>
Provides the data needed to Marshal.dump an association proxy.
17 18 19 |
# File 'lib/mongoid/association/marshalable.rb', line 17 def marshal_dump [ _base, _target, _association ] end |
#marshal_load(data) ⇒ Array<Object>
Takes the provided data and sets it back on the proxy.
29 30 31 32 |
# File 'lib/mongoid/association/marshalable.rb', line 29 def marshal_load(data) @_base, @_target, @_association = data extend_proxy(_association.extension) if _association.extension end |