1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-21 15:54:22 +01:00

fix debugging footprints

This commit is contained in:
Sylvain 2021-05-17 17:04:52 +02:00
parent 58287d7cee
commit 1f9a7ba6cc
2 changed files with 16 additions and 12 deletions

View File

@ -48,6 +48,9 @@ class FootprintService
columns = FootprintService.footprint_columns(klass) columns = FootprintService.footprint_columns(klass)
current = FootprintService.footprint_data(klass, item, array: true) current = FootprintService.footprint_data(klass, item, array: true)
saved = FootprintDebug.find_by(footprint: item.footprint, klass: klass.name) saved = FootprintDebug.find_by(footprint: item.footprint, klass: klass.name)
if saved.nil?
puts "Debug data not found for #{klass} [ id: #{item.id} ]"
else
others = FootprintDebug.where('klass = ? AND data LIKE ? AND id != ?', klass, "#{item.id}%", saved.id) others = FootprintDebug.where('klass = ? AND data LIKE ? AND id != ?', klass, "#{item.id}%", saved.id)
puts "Debug footprint for #{klass} [ id: #{item.id} ]" puts "Debug footprint for #{klass} [ id: #{item.id} ]"
puts '-----------------------------------------' puts '-----------------------------------------'
@ -59,6 +62,7 @@ class FootprintService
puts '-----------------------------------------' puts '-----------------------------------------'
item.footprint_children.map(&:debug_footprint) item.footprint_children.map(&:debug_footprint)
end end
end
private private

View File

@ -15,7 +15,7 @@ class Integrity::ArchiveHelper
Invoice.where('created_at > ?', last_period.end_at).order(:id).each do |i| Invoice.where('created_at > ?', last_period.end_at).order(:id).each do |i|
next if i.check_footprint next if i.check_footprint
puts i.debug_footprint i.debug_footprint
raise "Invalid footprint for invoice #{i.id}" raise "Invalid footprint for invoice #{i.id}"
end end
else else
@ -23,7 +23,7 @@ class Integrity::ArchiveHelper
Invoice.order(:id).all.each do |i| Invoice.order(:id).all.each do |i|
next if i.check_footprint next if i.check_footprint
puts i.debug_footprint i.debug_footprint
raise "Invalid footprint for invoice #{i.id}" raise "Invalid footprint for invoice #{i.id}"
end end
end end