method

records_by_reflection

Importance_0
v4.0.2 - Show latest stable - 0 notes - Class: Preloader
records_by_reflection(association) private

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/associations/preloader.rb, line 142
      def records_by_reflection(association)
        records.group_by do |record|
          record_class = record.class
          reflection = record_class.reflections[association]

          unless reflection
            raise ActiveRecord::ConfigurationError, "Association named '#{association}' was not found on #{record_class.name}; "                                                      "perhaps you misspelled it?"
          end

          reflection
        end
      end
Register or log in to add new notes.