Module: RecordCache::Arel::TreeManager

Defined in:
lib/record_cache/datastore/active_record_30.rb,
lib/record_cache/datastore/active_record_31.rb,
lib/record_cache/datastore/active_record_32.rb,
lib/record_cache/datastore/active_record_40.rb,
lib/record_cache/datastore/active_record_41.rb

Overview

The method <ActiveRecord::Base>.find_by_sql is used to actually retrieve the data from the DB. Unfortunately the ActiveRelation record is not accessible from there, so it is piggy-back’d in the SQL string.

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



65
66
67
68
69
70
71
# File 'lib/record_cache/datastore/active_record_30.rb', line 65

def self.included(klass)
  klass.extend ClassMethods
  klass.send(:include, InstanceMethods)
  klass.class_eval do
    alias_method_chain :to_sql, :record_cache
  end
end