This method is deprecated or moved on the latest stable version.
The last existing version (v2.3.8) is shown here.
construct_join_attributes(associate)
protected
Construct attributes for :through pointing to owner and associate.
# File activerecord/lib/active_record/associations/has_many_through_association.rb, line 102
def construct_join_attributes(associate)
# TODO: revist this to allow it for deletion, supposing dependent option is supported
raise ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection.new(@owner, @reflection) if [:has_one, :has_many].include?(@reflection.source_reflection.macro)
join_attributes = construct_owner_attributes(@reflection.through_reflection).merge(@reflection.source_reflection.primary_key_name => associate.id)
if @reflection.options[:source_type]
join_attributes.merge!(@reflection.source_reflection.options[:foreign_type] => associate.class.base_class.name.to_s)
end
join_attributes
end