lib/prosopite.rb in prosopite-0.1.6 vs lib/prosopite.rb in prosopite-0.1.7
- old
+ new
@@ -151,12 +151,12 @@
raise NPlusOneQueriesError.new(notifications_str) if @raise
end
def subscribe
- tc[:prosopite_subscribed] ||= false
- return if tc[:prosopite_subscribed]
+ @subscribed ||= false
+ return if @subscribed
ActiveSupport::Notifications.subscribe 'sql.active_record' do |_, _, _, _, data|
sql = data[:sql]
if scan? && sql.include?('SELECT') && data[:cached].nil?
@@ -169,9 +169,9 @@
tc[:prosopite_query_caller][location_key] = caller.dup
end
end
end
- tc[:prosopite_subscribed] = true
+ @subscribed = true
end
end
end