Class: MarkMapper::Plugins::Associations::ManyEmbeddedProxy

Inherits:
EmbeddedCollection show all
Defined in:
lib/mark_mapper/plugins/associations/many_embedded_proxy.rb

Instance Attribute Summary

Attributes inherited from Proxy

#association, #proxy_owner, #target

Instance Method Summary collapse

Methods inherited from EmbeddedCollection

#<<, #build, #count, #find, #save_to_collection

Methods inherited from Collection

#include?, #reset, #to_ary

Methods inherited from Proxy

#as_json, #blank?, #initialize, #inspect, #loaded, #loaded?, #nil?, #present?, #proxy_respond_to?, #reload, #reset, #respond_to?, #send, #to_json

Constructor Details

This class inherits a constructor from MarkMapper::Plugins::Associations::Proxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MarkMapper::Plugins::Associations::Proxy

Instance Method Details

#replace(values) ⇒ Object


6
7
8
9
10
11
# File 'lib/mark_mapper/plugins/associations/many_embedded_proxy.rb', line 6

def replace(values)
  @_values = (values || []).compact.map do |v|
    v.respond_to?(:attributes) ? v.attributes : v
  end
  reset
end