Module: Switchman::ActiveRecord::StatementCache::ClassMethods

Defined in:
lib/switchman/active_record/statement_cache.rb

Instance Method Summary collapse

Instance Method Details

#create(connection, block = Proc.new) ⇒ Object



5
6
7
8
9
10
# File 'lib/switchman/active_record/statement_cache.rb', line 5

def create(connection, block = Proc.new)
  relation = block.call ::ActiveRecord::StatementCache::Params.new

  bind_map = ::ActiveRecord::StatementCache::BindMap.new(relation.bound_attributes )
  new relation.arel, bind_map
end