From 0b7e075ef6484ee491c3577ac4646bcec56a8219 Mon Sep 17 00:00:00 2001 From: Yuri Rudman Date: Wed, 27 Sep 2017 17:25:30 -0400 Subject: [PATCH] unconditionally seed all standard reports. Sometimes date of build for patch on new version could be older that build date of older version, and skipping file based on timestamp will lead to keeping records from old version https://bugzilla.redhat.com/show_bug.cgi?id=1494819 --- app/models/miq_report/seeding.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/miq_report/seeding.rb b/app/models/miq_report/seeding.rb index d443fe79cb6..8e4782306fb 100644 --- a/app/models/miq_report/seeding.rb +++ b/app/models/miq_report/seeding.rb @@ -62,8 +62,8 @@ def sync_from_file(filename, dir, typ) rec = find_by_filename(rpt[:filename]) if rec - if rec.filename && (rec.file_mtime.nil? || rec.file_mtime.utc < rpt[:file_mtime]) - _log.info("#{typ.titleize}: [#{rec.name}] file has been updated on disk, synchronizing with model") + if rec.filename + _log.info("#{typ.titleize}: [#{rec.name}] file exists, synchronizing with model") rec.update_attributes(rpt) rec.save end