Module: Flipper::Model::ActiveRecord
- Defined in:
- lib/flipper/model/active_record.rb
Instance Method Summary collapse
-
#flipper_id ⇒ Object
The id of the record when used as an actor.
-
#flipper_properties ⇒ Object
Properties used to evaluate expressions.
Instance Method Details
#flipper_id ⇒ Object
The id of the record when used as an actor.
class User < ActiveRecord::Base
end
user = User.first
Flipper.enable :some_feature, user
Flipper.enabled? :some_feature, user #=> true
13 14 15 |
# File 'lib/flipper/model/active_record.rb', line 13 def flipper_id "#{self.class.base_class.name};#{id}" end |
#flipper_properties ⇒ Object
Properties used to evaluate expressions
18 19 20 |
# File 'lib/flipper/model/active_record.rb', line 18 def flipper_properties {"type" => self.class.name}.merge(attributes) end |