delete_all(dependent = nil)public
Removes all records from the association without calling callbacks on the associated records. It honors the `:dependent` option. However if the `:dependent` value is `:destroy` then in that case the `:delete_all` deletion strategy for the association is applied.
You can force a particular deletion strategy by passing a parameter.
See delete for more info.
# File activerecord/lib/active_record/associations/collection_association.rb, line 185 def delete_all(dependent = nil) if dependent.present? && ![:nullify, :delete_all].include?(dependent) raise ArgumentError, "Valid values are :nullify or :delete_all" end dependent = if dependent.present? dependent elsif options[:dependent] == :destroy :delete_all else options[:dependent] end delete(:all, dependent: dependent).tap do reset loaded! end end