Class: ForgeryProtection::SqlEvent

Inherits:
ActiveSupport::Notifications::Event
  • Object
show all
Defined in:
lib/forgery_protection/sql_event.rb

Instance Method Summary collapse

Instance Method Details

#cache?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/forgery_protection/sql_event.rb', line 13

def cache?
  payload[:name] == 'CACHE'
end

#read?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/forgery_protection/sql_event.rb', line 5

def read?
  cache? || result.respond_to?(:each)
end

#write?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/forgery_protection/sql_event.rb', line 9

def write?
  !read?
end