Class: SqlcachedClient::ArelWrapper

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/sqlcached_client/arel.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeArelWrapper

Returns a new instance of ArelWrapper.



51
52
53
54
55
56
57
58
59
60
# File 'lib/sqlcached_client/arel.rb', line 51

def initialize
  # clone ActiveRecord::Base to avoid polluting the connection pool
  active_record = ::ActiveRecord::Base.clone
  def active_record.name
    'sqlcahed_client::dummy'
  end
  ::Arel::Table.engine = active_record.establish_connection(
    adapter: :nulldb)
  @arel_module = ::Arel
end

Instance Attribute Details

#arel_moduleObject (readonly)

Returns the value of attribute arel_module.



49
50
51
# File 'lib/sqlcached_client/arel.rb', line 49

def arel_module
  @arel_module
end

Class Method Details

.arel_moduleObject



63
64
65
# File 'lib/sqlcached_client/arel.rb', line 63

def arel_module
  instance.arel_module
end