instance method
construct_owner_attributes
Ruby on Rails 3.0.20
Since v3.0.20 Last seen in v3.0.20Signature
construct_owner_attributes(reflection)
Construct attributes for associate pointing to owner.
Parameters
-
reflectionreq
Source
# File activerecord/lib/active_record/associations/through_association_scope.rb, line 90
def construct_owner_attributes(reflection)
if as = reflection.options[:as]
{ "#{as}_id" => @owner.id,
"#{as}_type" => @owner.class.base_class.name.to_s }
else
{ reflection.primary_key_name => @owner.id }
end
end
Defined in activerecord/lib/active_record/associations/through_association_scope.rb line 90
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Associations::ThroughAssociationScope