Skip to content

Commit 34db2b7

Browse files
committed
remove count var
this change was unneccsary as nothing was gained from it
1 parent 05a90c3 commit 34db2b7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

activerecord/lib/active_record/associations/has_many_association.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,11 @@ def delete_or_nullify_all_records(method)
121121
# Deletes the records according to the <tt>:dependent</tt> option.
122122
def delete_records(records, method)
123123
if method == :destroy
124-
count = records.length
125124
records.each(&:destroy!)
126-
update_counter(-count) unless inverse_updates_counter_cache?
125+
update_counter(-records.length) unless inverse_updates_counter_cache?
127126
else
128127
scope = self.scope.where(reflection.klass.primary_key => records)
129-
count = delete_count(method, scope)
130-
update_counter(-count)
128+
update_counter(-delete_count(method, scope))
131129
end
132130
end
133131

0 commit comments

Comments
 (0)