Class: ActiveRecord::Associations::HasOneThroughAssociation

Inherits:
HasOneAssociation show all
Includes:
ThroughAssociationScope
Defined in:
lib/active_record/associations/has_one_through_association.rb

Instance Method Summary collapse

Methods inherited from HasOneAssociation

#build, #create, #create!, #initialize

Methods inherited from AssociationProxy

#===, #aliased_table_name, #conditions, #initialize, #inspect, #loaded, #loaded?, #proxy_owner, #proxy_reflection, #proxy_respond_to?, #proxy_target, #reload, #reset, #respond_to?, #send, #target, #target=

Constructor Details

This class inherits a constructor from ActiveRecord::Associations::HasOneAssociation

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActiveRecord::Associations::AssociationProxy

Instance Method Details

#replace(new_value) ⇒ Object



9
10
11
12
# File 'lib/active_record/associations/has_one_through_association.rb', line 9

def replace(new_value)
  create_through_record(new_value)
  @target = new_value
end