Sha256: 6de19b0b03bce65968715a52776ebe212c93d1a2625fffe63d560cd85b8d55f1

Contents?: true

Size: 313 Bytes

Versions: 1

Compression:

Stored size: 313 Bytes

Contents

# frozen_string_literal: true

module ActiveRecordScopingWithAssoc
  KEY = :_activerecord_scoping_with_assoc

  module Relation
    def scoping_with_assoc
      Thread.current[KEY] ||= {}
      Thread.current[KEY][klass] = true
      scoping { yield }
    ensure
      Thread.current[KEY] = nil
    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/relation.rb