Class: ActiveRecord::Embedded::Association::Parent

Inherits:
ActiveRecord::Embedded::Association show all
Defined in:
lib/active_record/embedded/association/parent.rb

Overview

Parent associations are a “reverse” association defined on the embedded model, which reference the parent model in an easy-to-use way.

Instance Attribute Summary collapse

Attributes inherited from ActiveRecord::Embedded::Association

#class_name, #name

Instance Method Summary collapse

Methods inherited from ActiveRecord::Embedded::Association

#assign, #build, #create, #destroy, #embedded_class, #find, #index, #initialize, #query, #update

Constructor Details

This class inherits a constructor from ActiveRecord::Embedded::Association

Instance Attribute Details

#asObject (readonly)

Returns the value of attribute as


10
11
12
# File 'lib/active_record/embedded/association/parent.rb', line 10

def as
  @as
end

Instance Method Details

#associationObject


12
13
14
# File 'lib/active_record/embedded/association/parent.rb', line 12

def association
  embedded_class.embeds[as.to_sym]
end