Class: MagicScopes::BooleanScopesGenerator
- Inherits:
-
ScopesGenerator::Base
- Object
- ScopesGenerator::Base
- MagicScopes::BooleanScopesGenerator
- Includes:
- PresenceScopes
- Defined in:
- lib/magic_scopes/scopes_generators/boolean.rb
Instance Method Summary collapse
Methods included from PresenceScopes
Methods inherited from ScopesGenerator::Base
Constructor Details
This class inherits a constructor from MagicScopes::ScopesGenerator::Base
Instance Method Details
#is(name) ⇒ Object
6 7 8 |
# File 'lib/magic_scopes/scopes_generators/boolean.rb', line 6 def is(name) scope name || @attr, where("#{@key}" => true) end |
#not(name) ⇒ Object
10 11 12 |
# File 'lib/magic_scopes/scopes_generators/boolean.rb', line 10 def not(name) scope name || "not_#{@attr}", where("#{@key}" => [false, nil]) end |