method
add_record_to_target_with_callbacks

add_record_to_target_with_callbacks(record)
private
Hide source
# File activerecord/lib/active_record/associations/association_collection.rb, line 421 def add_record_to_target_with_callbacks(record) callback(:before_add, record) yield(record) if block_given? @target ||= [] unless loaded? @target << record unless @reflection.options[:uniq] && @target.include?(record) callback(:after_add, record) record end