debian-mirror-gitlab/lib/gem_extensions/active_record/associations/preloader/through_association.rb
2021-10-27 15:23:28 +05:30

23 lines
445 B
Ruby

# 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