method
initialize_relation_delegate_cache
v4.2.7 -
Show latest stable
- Class:
ActiveRecord::Delegation::DelegateCache
initialize_relation_delegate_cache()public
No documentation available.
# File activerecord/lib/active_record/relation/delegation.rb, line 12
def initialize_relation_delegate_cache # :nodoc:
@relation_delegate_cache = cache = {}
[
ActiveRecord::Relation,
ActiveRecord::Associations::CollectionProxy,
ActiveRecord::AssociationRelation
].each do |klass|
delegate = Class.new(klass) {
include ClassSpecificRelation
}
const_set klass.name.gsub('::', '_'), delegate
cache[klass] = delegate
end
end