diff options
Diffstat (limited to 'lib/gem_extensions/active_record/associations/has_many_through_association.rb')
-rw-r--r-- | lib/gem_extensions/active_record/associations/has_many_through_association.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/gem_extensions/active_record/associations/has_many_through_association.rb b/lib/gem_extensions/active_record/associations/has_many_through_association.rb new file mode 100644 index 00000000000..e7051e4d9cb --- /dev/null +++ b/lib/gem_extensions/active_record/associations/has_many_through_association.rb @@ -0,0 +1,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 |