Flowdock
add_to_target(record, skip_callbacks = false) public

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/collection_association.rb, line 387
      def add_to_target(record, skip_callbacks = false)
        callback(:before_add, record) unless skip_callbacks
        yield(record) if block_given?

        if association_scope.distinct_value && index = @target.index(record)
          @target[index] = record
        else
          @target << record
        end

        callback(:after_add, record) unless skip_callbacks
        set_inverse_instance(record)

        record
      end
Register or log in to add new notes.