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:
parent
58287d7cee
commit
1f9a7ba6cc
@ -48,16 +48,20 @@ 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)
|
||||||
others = FootprintDebug.where('klass = ? AND data LIKE ? AND id != ?', klass, "#{item.id}%", saved.id)
|
if saved.nil?
|
||||||
puts "Debug footprint for #{klass} [ id: #{item.id} ]"
|
puts "Debug data not found for #{klass} [ id: #{item.id} ]"
|
||||||
puts '-----------------------------------------'
|
else
|
||||||
puts "columns: [ #{columns.join(', ')} ]"
|
others = FootprintDebug.where('klass = ? AND data LIKE ? AND id != ?', klass, "#{item.id}%", saved.id)
|
||||||
puts "current: #{current}"
|
puts "Debug footprint for #{klass} [ id: #{item.id} ]"
|
||||||
puts " saved: #{saved.format_data(item.id)}"
|
puts '-----------------------------------------'
|
||||||
puts '-----------------------------------------'
|
puts "columns: [ #{columns.join(', ')} ]"
|
||||||
puts "other possible matches IDs: #{others.map(&:id)}"
|
puts "current: #{current}"
|
||||||
puts '-----------------------------------------'
|
puts " saved: #{saved.format_data(item.id)}"
|
||||||
item.footprint_children.map(&:debug_footprint)
|
puts '-----------------------------------------'
|
||||||
|
puts "other possible matches IDs: #{others.map(&:id)}"
|
||||||
|
puts '-----------------------------------------'
|
||||||
|
item.footprint_children.map(&:debug_footprint)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user