Project

General

Profile

« Previous | Next » 

Revision 867cd959

Added by Dominic Cleal almost 9 years ago

fixes #10216 - sort report log messages in natural order

(cherry picked from commit 671b0b4409e2ac732613ad2af5d4cd4432f39333)

View differences:

app/models/report.rb
cond += " and reports.status = #{status}" unless status.nil?
Log.joins(:report).where(:report_id => Report.where(cond)).delete_all
Message.where("id not IN (#{Log.select('DISTINCT message_id').to_sql})").delete_all
Source.where("id not IN (#{Log.select('DISTINCT source_id').to_sql})").delete_all
Message.where("id not IN (#{Log.unscoped.select('DISTINCT message_id').to_sql})").delete_all
Source.where("id not IN (#{Log.unscoped.select('DISTINCT source_id').to_sql})").delete_all
count = Report.where(cond).delete_all
logger.info Time.now.to_s + ": Expired #{count} Reports"
count

Also available in: Unified diff