Skip to content

Commit a7715cd

Browse files
committed
Active Support trick
1 parent 5c20172 commit a7715cd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/jobs/auto_close_complaints_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def perform(*_args)
77
statuses = complaints.map do |complaint|
88
complaint.update_status 'closed'
99
end
10-
successful = statuses.map { |x| (x && 1) || 0 }.sum
10+
successful = statuses.compact_blank.size
1111
logger.info "Found #{complaints.size} inactive complaints, successfully closed #{successful} of them."
1212
end
1313
end

0 commit comments

Comments
 (0)