method

reset_association

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ThroughAssociation

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v5.1.7) is shown here.

reset_association(owners, association_name) 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 70
          def reset_association(owners, association_name)
            should_reset = (through_scope != through_reflection.klass.unscoped) ||
               (reflection.options[:source_type] && through_reflection.collection?)

            # Don't cache the association - we would only be caching a subset
            if should_reset
              owners.each { |owner|
                owner.association(association_name).reset
              }
            end
          end
Register or log in to add new notes.