method

normalized_reflections

rails latest stable - Class: ActiveRecord::Reflection::ClassMethods

Method not available on this version

This method is only available on newer versions. The first available version (v7.2.3) is shown here.

normalized_reflections()
public

No documentation available.

# File activerecord/lib/active_record/reflection.rb, line 82
      def normalized_reflections # :nodoc:
        @__reflections ||= begin
          ref = {}

          _reflections.each do |name, reflection|
            parent_reflection = reflection.parent_reflection

            if parent_reflection
              parent_name = parent_reflection.name
              ref[parent_name] = parent_reflection
            else
              ref[name] = reflection
            end
          end

          ref.freeze
        end
      end