lib/prosopite.rb in prosopite-1.3.2 vs lib/prosopite.rb in prosopite-1.3.3
- old
+ new
@@ -10,16 +10,17 @@
attr_writer :raise,
:stderr_logger,
:rails_logger,
:prosopite_logger,
:custom_logger,
- :allow_stack_paths,
- :ignore_queries,
:ignore_pauses,
- :min_n_queries,
:backtrace_cleaner
+ attr_accessor :allow_stack_paths,
+ :ignore_queries,
+ :min_n_queries
+
def allow_list=(value)
puts "Prosopite.allow_list= is deprecated. Use Prosopite.allow_stack_paths= instead."
self.allow_stack_paths = value
end
@@ -244,16 +245,17 @@
ActiveSupport::Notifications.subscribe 'sql.active_record' do |_, _, _, _, data|
sql, name = data[:sql], data[:name]
if scan? && name != "SCHEMA" && sql.include?('SELECT') && data[:cached].nil? && !ignore_query?(sql)
- location_key = Digest::SHA1.hexdigest(caller.join)
+ query_caller = caller
+ location_key = Digest::SHA256.hexdigest(query_caller.join)
tc[:prosopite_query_counter][location_key] += 1
tc[:prosopite_query_holder][location_key] << sql
if tc[:prosopite_query_counter][location_key] > 1
- tc[:prosopite_query_caller][location_key] = caller.dup
+ tc[:prosopite_query_caller][location_key] = query_caller.dup
end
end
end
@subscribed = true