123456789_123456789_123456789_123456789_123456789_

Module: ActiveRecord::Scoping

Relationships & Source Files
Namespace Children
Modules:
Extension / Inclusion / Inheritance Descendants
Included In:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Defined in: activerecord/lib/active_record/scoping/named.rb,
activerecord/lib/active_record.rb,
activerecord/lib/active_record/scoping.rb,
activerecord/lib/active_record/scoping/default.rb

Overview

Active Record Named Scopes

Class Method Summary

Instance Method Summary

DSL Calls

included

[ GitHub ]


7
8
9
10
# File 'activerecord/lib/active_record/scoping.rb', line 7

included do
  include Default
  include Named
end

Instance Method Details

#initialize_internals_callback

[ GitHub ]

  
# File 'activerecord/lib/active_record/scoping.rb', line 30

def initialize_internals_callback
  super
  populate_with_current_scope_attributes
end

#populate_with_current_scope_attributes

[ GitHub ]

  
# File 'activerecord/lib/active_record/scoping.rb', line 22

def populate_with_current_scope_attributes
  return unless self.class.scope_attributes?

  self.class.scope_attributes.each do |att,value|
    send("#{att}=", value) if respond_to?("#{att}=")
  end
end