Sha256: 24a9b0c6992955b9e9267a1de874d3df43c231cfe8ed03044181ef5dca27ccf9

Contents?: true

Size: 282 Bytes

Versions: 1

Compression:

Stored size: 282 Bytes

Contents

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.0 lib/activerecord_scoping_with_assoc/relation.rb