Commit 26c5f32bfc1adc71f98c4c67dea80506529da01a

Authored by Marcin Ciunelis
1 parent 59a9e1df
Exists in master and in 1 other branch production

update fingerprints

app/models/error_report.rb
... ... @@ -59,7 +59,7 @@ class ErrorReport
59 59 private
60 60 def fingerprint_source
61 61 {
62   - :backtrace => backtrace_head.map(&:to_s),
  62 + :backtrace => backtrace.id,
63 63 :error_class => error_class,
64 64 :component => component,
65 65 :action => action,
... ... @@ -68,9 +68,5 @@ class ErrorReport
68 68 }
69 69 end
70 70  
71   - def backtrace_head
72   - backtrace.lines[0..3]
73   - end
74   -
75 71 end
76 72  
... ...
db/migrate/20121005142110_regenerate_err_fingerprints.rb 0 → 100644
... ... @@ -0,0 +1,19 @@
  1 +class RegenerateErrFingerprints < Mongoid::Migration
  2 + def self.up
  3 + Err.all.each do |err|
  4 + fingerprint_source = {
  5 + :backtrace => err.notices.first.backtrace_id,
  6 + :error_class => err.error_class,
  7 + :component => err.component,
  8 + :action => err.action,
  9 + :environment => err.environment,
  10 + :api_key => err.app.api_key
  11 + }
  12 + fingerprint = Digest::SHA1.hexdigest(fingerprint_source.to_s)
  13 + err.update_attribute(:fingerprint, fingerprint)
  14 + end
  15 + end
  16 +
  17 + def self.down
  18 + end
  19 +end
... ...