app/models/errdo/error.rb in errdo-0.12.10 vs app/models/errdo/error.rb in errdo-0.12.11
- old
+ new
@@ -1,10 +1,12 @@
include Errdo::HistogramHelper
module Errdo
class Error < ActiveRecord::Base
+ REJECTION_REGEX = %r{\/ruby-[0-9]*\.[0-9]*\.[0-9]*\/|\/(ruby|gems)\/[0-9]*\.[0-9]*\.[0-9]*\/(gems|bin|webrick)|_test.rb|\/app\/bin\/bundle}
+
paginates_per 20
self.table_name = Errdo.error_name
enum status: [:active, :wontfix, :resolved]
@@ -29,11 +31,11 @@
end
# I need a more elegant way to do this
def self.create_unique_string_from_params(params)
Digest::SHA1.hexdigest(
- params[:backtrace].reject { |l| l[%r{\/ruby-[0-9]*\.[0-9]*\.[0-9]*\/|_test.rb}] }.join("") +
+ params[:backtrace].reject { |l| l[REJECTION_REGEX] }.join("") +
params[:exception_message].to_s.gsub(/:0x[0-f]{14}/, "") +
params[:exception_class_name].to_s
).to_s
end
@@ -74,10 +76,10 @@
private
def create_unique_string
self.backtrace_hash =
- Digest::SHA1.hexdigest(backtrace.to_a.reject { |l| l[%r{\/ruby-[0-9]*\.[0-9]*\.[0-9]*\/|_test.rb}] }.join("") +
+ Digest::SHA1.hexdigest(backtrace.to_a.reject { |l| l[REJECTION_REGEX] }.join("") +
exception_message.to_s.gsub(/:0x[0-f]{14}/, "") +
exception_class_name.to_s).to_s
end
end