mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-19 13:54:25 +01:00
fix debugging footprints
This commit is contained in:
parent
58287d7cee
commit
1f9a7ba6cc
@ -48,16 +48,20 @@ class FootprintService
|
||||
columns = FootprintService.footprint_columns(klass)
|
||||
current = FootprintService.footprint_data(klass, item, array: true)
|
||||
saved = FootprintDebug.find_by(footprint: item.footprint, klass: klass.name)
|
||||
others = FootprintDebug.where('klass = ? AND data LIKE ? AND id != ?', klass, "#{item.id}%", saved.id)
|
||||
puts "Debug footprint for #{klass} [ id: #{item.id} ]"
|
||||
puts '-----------------------------------------'
|
||||
puts "columns: [ #{columns.join(', ')} ]"
|
||||
puts "current: #{current}"
|
||||
puts " saved: #{saved.format_data(item.id)}"
|
||||
puts '-----------------------------------------'
|
||||
puts "other possible matches IDs: #{others.map(&:id)}"
|
||||
puts '-----------------------------------------'
|
||||
item.footprint_children.map(&:debug_footprint)
|
||||
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)
|
||||
puts "Debug footprint for #{klass} [ id: #{item.id} ]"
|
||||
puts '-----------------------------------------'
|
||||
puts "columns: [ #{columns.join(', ')} ]"
|
||||
puts "current: #{current}"
|
||||
puts " saved: #{saved.format_data(item.id)}"
|
||||
puts '-----------------------------------------'
|
||||
puts "other possible matches IDs: #{others.map(&:id)}"
|
||||
puts '-----------------------------------------'
|
||||
item.footprint_children.map(&:debug_footprint)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -15,7 +15,7 @@ class Integrity::ArchiveHelper
|
||||
Invoice.where('created_at > ?', last_period.end_at).order(:id).each do |i|
|
||||
next if i.check_footprint
|
||||
|
||||
puts i.debug_footprint
|
||||
i.debug_footprint
|
||||
raise "Invalid footprint for invoice #{i.id}"
|
||||
end
|
||||
else
|
||||
@ -23,7 +23,7 @@ class Integrity::ArchiveHelper
|
||||
Invoice.order(:id).all.each do |i|
|
||||
next if i.check_footprint
|
||||
|
||||
puts i.debug_footprint
|
||||
i.debug_footprint
|
||||
raise "Invalid footprint for invoice #{i.id}"
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user