Class: ForgeryProtection::QueryTracker
- Inherits:
-
Object
- Object
- ForgeryProtection::QueryTracker
- Defined in:
- lib/forgery_protection/query_tracker.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.record_sql_event(event) ⇒ Object
6 7 8 |
# File 'lib/forgery_protection/query_tracker.rb', line 6 def self.record_sql_event(event) sql_events << event end |
.reset_sql_events ⇒ Object
14 15 16 |
# File 'lib/forgery_protection/query_tracker.rb', line 14 def self.reset_sql_events sql_events.clear end |
.sql_events ⇒ Object
10 11 12 |
# File 'lib/forgery_protection/query_tracker.rb', line 10 def self.sql_events Thread.current['active_record_sql_events'] ||= [] end |
Instance Method Details
#call(*args) ⇒ Object
18 19 20 |
# File 'lib/forgery_protection/query_tracker.rb', line 18 def call(*args) self.class.record_sql_event SqlEvent.new(*args) end |