Skip to content

Commit

Permalink
cast value with on rule setter on user behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed May 24, 2018
1 parent 6d3477d commit 617c7a6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/policy_manager/concerns/user_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module PolicyManager::Concerns::UserBehavior
end

define_method :"#{rule_name}=" do |val=true|
val = ActiveRecord::Type::Boolean.new.cast(val)
self.instance_variable_set("@#{rule_name}", val)
ut = user_terms.new
ut.term = policy_term_on(rule.name)
Expand Down

0 comments on commit 617c7a6

Please sign in to comment.