Class: Flipside::Feature
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Flipside::Feature
show all
- Extended by:
- Checks
- Includes:
- Entities, Roles
- Defined in:
- app/models/flipside/feature.rb
Instance Method Summary
collapse
Methods included from Checks
add_check, checks
Methods included from Roles
#has_role?, included, #lookup_methods_for
Methods included from Entities
included
Instance Method Details
#active? ⇒ Boolean
22
23
24
|
# File 'app/models/flipside/feature.rb', line 22
def active?
activated? && !deactivated?
end
|
#enabled?(object = nil) ⇒ Boolean
15
16
17
18
19
20
|
# File 'app/models/flipside/feature.rb', line 15
def enabled?(object = nil)
return false unless active?
return true if enabled
self.class.checks.any? { |check| instance_exec(object, &check) }
end
|