method
delete_records
delete_records(records)
protected
Hide source
# File activerecord/lib/active_record/associations/has_many_association.rb, line 53 def delete_records(records) case @reflection.options[:dependent] when :destroy records.each(&:destroy) when :delete_all @reflection.klass.delete(records.map(&:id)) else ids = quoted_record_ids(records) @reflection.klass.update_all( "#{@reflection.primary_key_name} = NULL", "#{@reflection.primary_key_name} = #{@owner.quoted_id} AND #{@reflection.klass.primary_key} IN (#{ids})" ) end end