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/has_many_through_association.rb, line 86
        def build_record(attributes)
          ensure_not_nested

          @through_scope = scope
          record = super

          inverse = source_reflection.inverse_of
          if inverse
            if inverse.collection?
              record.send(inverse.name) << build_through_record(record)
            elsif inverse.has_one?
              record.send("#{inverse.name}=", build_through_record(record))
            end
          end

          record
        ensure
          @through_scope = nil
        end
Register or log in to add new notes.