Module: ActiveRecordScopingWithAssoc::Relation

Defined in:
lib/activerecord_scoping_with_assoc/relation.rb

Instance Method Summary collapse

Instance Method Details

#scoping_with_assocObject



5
6
7
8
9
10
11
# File 'lib/activerecord_scoping_with_assoc/relation.rb', line 5

def scoping_with_assoc
  Thread.current[KEY] ||= {}
  Thread.current[KEY][klass] = true
  scoping { yield }
ensure
  Thread.current[KEY] = nil
end