Flowdock
method

through_records_by_owner

Importance_0
v4.0.2 - Show latest stable - 0 notes - Class: ThroughAssociation
through_records_by_owner() 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/through_association.rb, line 27
        def through_records_by_owner
          Preloader.new(owners, through_reflection.name, through_scope).run

          Hash[owners.map do |owner|
            through_records = Array.wrap(owner.send(through_reflection.name))

            # Dont cache the association - we would only be caching a subset
            if (through_scope != through_reflection.klass.unscoped) ||
               (reflection.options[:source_type] && through_reflection.collection?)
              owner.association(through_reflection.name).reset
            end

            [owner, through_records]
          end]
        end
Register or log in to add new notes.