Flowdock
method

add_record_to_target_with_callbacks

Importance_0
Ruby on Rails latest stable (v4.1.8) - 0 notes - Class: ActiveRecord::Associations::AssociationCollection

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.0.9) is shown here.

add_record_to_target_with_callbacks(record) protected

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/association_collection.rb, line 478
        def add_record_to_target_with_callbacks(record)
          callback(:before_add, record)
          yield(record) if block_given?
          @target ||= [] unless loaded?
          if index = @target.index(record)
            @target[index] = record
          else
             @target << record
          end
          callback(:after_add, record)
          set_inverse_instance(record, @owner)
          record
        end
Register or log in to add new notes.