Class: MongoMapper::Associations::ManyEmbeddedPolymorphicProxy
- Inherits:
-
Collection
- Object
- Proxy
- Collection
- MongoMapper::Associations::ManyEmbeddedPolymorphicProxy
- Defined in:
- lib/mongo_mapper/associations/many_embedded_polymorphic_proxy.rb
Instance Attribute Summary
Attributes inherited from Proxy
Instance Method Summary collapse
Methods inherited from Collection
Methods inherited from Proxy
#===, #blank?, #initialize, #inspect, #loaded, #loaded?, #nil?, #present?, #proxy_respond_to?, #reload, #reset, #respond_to?, #send
Constructor Details
This class inherits a constructor from MongoMapper::Associations::Proxy
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class MongoMapper::Associations::Proxy
Instance Method Details
#replace(values) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/mongo_mapper/associations/many_embedded_polymorphic_proxy.rb', line 4 def replace(values) @_values = values.map do |v| if v.kind_of?(EmbeddedDocument) v.attributes.merge(reflection.type_key_name => v.class.name) else v end end reset end |