Flowdock
method

build_record

Importance_0
v7.1.3.2 - Show latest stable - 0 notes - Class: ThroughAssociation
build_record(attributes) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/associations/through_association.rb, line 116
        def build_record(attributes)
          if source_reflection.collection?
            inverse = source_reflection.inverse_of
            target = through_association.target

            if inverse && target && !target.is_a?(Array)
              Array(target.id).zip(Array(inverse.foreign_key)).map do |primary_key_value, foreign_key_column|
                attributes[foreign_key_column] = primary_key_value
              end
            end
          end

          super
        end
Register or log in to add new notes.