Class: ReputationBehaviour
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ReputationBehaviour
- Defined in:
- app/models/reputation_behaviour.rb
Instance Method Summary collapse
-
#rule=(rule) ⇒ Object
Set the rule, can either be a ReputationRule or the name of the rule.
Instance Method Details
#rule=(rule) ⇒ Object
Set the rule, can either be a ReputationRule or the name of the rule
23 24 25 26 27 28 29 30 |
# File 'app/models/reputation_behaviour.rb', line 23 def rule=(rule) write_attribute :rule_id, case rule when ReputationRule rule.id else ReputationRule.find_by_name( rule ).try(:id) end end |