mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
remove count var
this change was unneccsary as nothing was gained from it
This commit is contained in:
parent
05a90c36c5
commit
34db2b7caa
1 changed files with 2 additions and 4 deletions
|
@ -121,13 +121,11 @@ module ActiveRecord
|
||||||
# Deletes the records according to the <tt>:dependent</tt> option.
|
# Deletes the records according to the <tt>:dependent</tt> option.
|
||||||
def delete_records(records, method)
|
def delete_records(records, method)
|
||||||
if method == :destroy
|
if method == :destroy
|
||||||
count = records.length
|
|
||||||
records.each(&:destroy!)
|
records.each(&:destroy!)
|
||||||
update_counter(-count) unless inverse_updates_counter_cache?
|
update_counter(-records.length) unless inverse_updates_counter_cache?
|
||||||
else
|
else
|
||||||
scope = self.scope.where(reflection.klass.primary_key => records)
|
scope = self.scope.where(reflection.klass.primary_key => records)
|
||||||
count = delete_count(method, scope)
|
update_counter(-delete_count(method, scope))
|
||||||
update_counter(-count)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue