Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/scope_chain.rb

Overview

Hooks so named scopes are sane

Class Method Summary collapse

Class Method Details

.scope_with_tracking(*args, &block) ⇒ Object



147
148
149
150
# File 'lib/scope_chain.rb', line 147

def self.scope_with_tracking(*args, &block)
  (@@scopes ||= Hash.new {|hash, key| hash[key] = [] })[self.name].push args.first
  scope_without_tracking *args, &block
end