Welcome to mirror list, hosted at ThFree Co, Russian Federation.

through_association.rb « preloader « associations « active_record « gem_extensions « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 16b53846a585cc14decb85e5ff9b7a3b12ea6d9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module GemExtensions
  module ActiveRecord
    module Associations
      module Preloader
        module ThroughAssociation
          extend ActiveSupport::Concern

          def through_scope
            scope = through_reflection.klass.unscoped
            options = reflection.options

            return scope if options[:disable_joins]

            super
          end
        end
      end
    end
  end
end