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

has_many_through_association.rb « 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: e7051e4d9cbfdabef262f6dd528d16c3cb2c62aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module GemExtensions
  module ActiveRecord
    module Associations
      module HasManyThroughAssociation
        extend ActiveSupport::Concern

        def find_target
          return [] unless target_reflection_has_associated_record?
          return scope.to_a if disable_joins

          super
        end
      end
    end
  end
end