method

future_classes

Importance_0
v7.0.0 - Show latest stable - 0 notes - Class: ThroughAssociation
future_classes() 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/associations/preloader/through_association.rb, line 51
        def future_classes
          if run?
            []
          elsif through_preloaders.all?(&:run?)
            source_preloaders.flat_map(&:future_classes).uniq
          else
            through_classes = through_preloaders.flat_map(&:future_classes)
            source_classes = source_reflection.
              chain.
              reject { |reflection| reflection.respond_to?(:polymorphic?) && reflection.polymorphic? }.
              map(&:klass)
            (through_classes + source_classes).uniq
          end
        end
Register or log in to add new notes.