Module: StatelyScopes::ClassMethods

Defined in:
lib/stately_scopes.rb

Instance Method Summary collapse

Instance Method Details

#scope_with_state(name, body, &block) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/stately_scopes.rb', line 20

def scope_with_state(name, body, &block)
  if StatelyScopes.configuration.alias_scope_method
    scope_without_state name, body, &block
  else
    scope name, body, &block
  end
  class_eval "def #{name}?() self.has_scoped_state?(:#{name}) end"
end