method

initialize_relation_delegate_cache

Importance_0
v7.1.3.2 - Show latest stable - 0 notes - Class: DelegateCache
initialize_relation_delegate_cache() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/relation/delegation.rb, line 30
      def initialize_relation_delegate_cache
        @relation_delegate_cache = cache = {}
        Delegation.delegated_classes.each do |klass|
          delegate = Class.new(klass) {
            include ClassSpecificRelation
          }
          include_relation_methods(delegate)
          mangled_name = klass.name.gsub("::", "_")
          const_set mangled_name, delegate
          private_constant mangled_name

          cache[klass] = delegate
        end
      end
Register or log in to add new notes.