Module: DerGuteMoritz::ActiveRecord::LazyAttributes

Defined in:
lib/lazy_attributes.rb

Defined Under Namespace

Modules: ClassMethods, JoinBase

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/lazy_attributes.rb', line 8

def self.included(base)
  base.class_eval do
    class_inheritable_accessor :lazy_attributes
    class_inheritable_accessor :eager_attributes
    class_inheritable_accessor :eager_attributes_quoted
    self.lazy_attributes = []
    extend ClassMethods
    send(respond_to?(:singleton_class) ? :singleton_class : :metaclass).alias_method_chain :default_select, :lazy_attributes
  end

  ::ActiveRecord::Associations::ClassMethods::JoinDependency::JoinBase.send :include, JoinBase
end