edge badge
Methods
C
N
Attributes
[RW] ignored_sql
[RW] log
[RW] log_all
[R] ignore
Class Public methods
clear_log()
# File activerecord/lib/active_record/test_case.rb, line 58
def clear_log; self.log = []; self.log_all = []; end
new(ignore = Regexp.union(self.class.ignored_sql))
# File activerecord/lib/active_record/test_case.rb, line 79
def initialize(ignore = Regexp.union(self.class.ignored_sql))
  @ignore = ignore
end
Instance Public methods
call(name, start, finish, message_id, values)
# File activerecord/lib/active_record/test_case.rb, line 83
def call(name, start, finish, message_id, values)
  sql = values[:sql]

  # FIXME: this seems bad. we should probably have a better way to indicate
  # the query was cached
  return if 'CACHE' == values[:name]

  self.class.log_all << sql
  self.class.log << sql unless ignore =~ sql
end