class RailsBand::ActiveRecord::Event::Sql

A wrapper for the event that is passed to ‘sql.active_record`.

Public Instance Methods

async() click to toggle source
# File lib/rails_band/active_record/event/sql.rb, line 35
def async
  return @async if defined? @async

  @async = @event.payload[:async]
end
binds() click to toggle source
# File lib/rails_band/active_record/event/sql.rb, line 17
def binds
  @binds ||= @event.payload.fetch(:binds)
end
cached() click to toggle source
# File lib/rails_band/active_record/event/sql.rb, line 41
def cached
  return @cached if defined? @cached

  @cached = @event.payload[:cached]
end
connection() click to toggle source
# File lib/rails_band/active_record/event/sql.rb, line 25
def connection
  @connection ||= @event.payload.fetch(:connection)
end
sql() click to toggle source
# File lib/rails_band/active_record/event/sql.rb, line 8
def sql
  @sql ||= @event.payload.fetch(:sql)
end
sql_name() click to toggle source

@note This method is renamed in order to avoid conflicts with BaseEvent#name.

# File lib/rails_band/active_record/event/sql.rb, line 13
def sql_name
  @sql_name ||= @event.payload.fetch(:name)
end
statement_name() click to toggle source
# File lib/rails_band/active_record/event/sql.rb, line 29
def statement_name
  return @statement_name if defined? @statement_name

  @statement_name = @event.payload[:statement_name]
end
type_casted_binds() click to toggle source
# File lib/rails_band/active_record/event/sql.rb, line 21
def type_casted_binds
  @type_casted_binds ||= @event.payload.fetch(:type_casted_binds)
end