Sha256: e4d3cb7bce76f6e9d5490d2afa16ea6ffc472f6a438812284626e4817b3a5348

Contents?: true

Size: 319 Bytes

Versions: 1

Compression:

Stored size: 319 Bytes

Contents

# frozen_string_literal: true

module ActiveRecordScopingWithAssoc
  module Association
    def target_scope
      if Thread.current[KEY] && Thread.current[KEY][klass] == true
        ActiveRecord::AssociationRelation.create(klass, self).merge!(klass.current_scope)
      else
        super
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord_scoping_with_assoc-0.1.1 lib/activerecord_scoping_with_assoc/association.rb