remove count var
this change was unneccsary as nothing was gained from it
This commit is contained in:
parent
05a90c36c5
commit
34db2b7caa
@ -121,13 +121,11 @@ def delete_or_nullify_all_records(method)
|
||||
# Deletes the records according to the <tt>:dependent</tt> option.
|
||||
def delete_records(records, method)
|
||||
if method == :destroy
|
||||
count = records.length
|
||||
records.each(&:destroy!)
|
||||
update_counter(-count) unless inverse_updates_counter_cache?
|
||||
update_counter(-records.length) unless inverse_updates_counter_cache?
|
||||
else
|
||||
scope = self.scope.where(reflection.klass.primary_key => records)
|
||||
count = delete_count(method, scope)
|
||||
update_counter(-count)
|
||||
update_counter(-delete_count(method, scope))
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user