Method: ActiveRecord::Core::ClassMethods#cached_find_by_statement

Defined in:
activerecord/lib/active_record/core.rb

#cached_find_by_statement(connection, key, &block) ⇒ Object

:nodoc:



391
392
393
394
# File 'activerecord/lib/active_record/core.rb', line 391

def cached_find_by_statement(connection, key, &block) # :nodoc:
  cache = @find_by_statement_cache[connection.prepared_statements]
  cache.compute_if_absent(key) { StatementCache.create(connection, &block) }
end