Class: ActiveData::Model::Associations::PersistenceAdapters::ActiveRecord::ReferencedProxy

Inherits:
Collection::Proxy
  • Object
show all
Defined in:
lib/active_data/model/associations/persistence_adapters/active_record/referenced_proxy.rb

Constant Summary collapse

METHODS_EXCLUDED_FROM_DELEGATION =

You can’t create data directly through ActiveRecord::Relation

%w[build create create!].map(&:to_sym).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Collection::Proxy

#initialize, #inspect, #to_ary

Constructor Details

This class inherits a constructor from ActiveData::Model::Associations::Collection::Proxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



13
14
15
# File 'lib/active_data/model/associations/persistence_adapters/active_record/referenced_proxy.rb', line 13

def method_missing(method, *args, &block)
  delegate_to_scope?(method) ? scope.send(method, *args, &block) : super
end

Instance Attribute Details

#associationObject (readonly)

Returns the value of attribute association.



10
11
12
# File 'lib/active_data/model/associations/persistence_adapters/active_record/referenced_proxy.rb', line 10

def association
  @association
end

Instance Method Details

#respond_to_missing?(method, include_private = false) ⇒ Boolean

Returns:



17
18
19
# File 'lib/active_data/model/associations/persistence_adapters/active_record/referenced_proxy.rb', line 17

def respond_to_missing?(method, include_private = false)
  delegate_to_scope?(method) || super
end