Class: NextSgad::Result
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- ApplicationRecord
- NextSgad::Result
- Defined in:
- app/models/next_sgad/result.rb
Instance Method Summary collapse
- #change_status ⇒ Object
-
#increase_amount ⇒ Object
enum result_type: NextSgad::Goal.goal_types.
Methods inherited from ApplicationRecord
#create_number, #create_number!
Instance Method Details
#change_status ⇒ Object
20 21 22 23 |
# File 'app/models/next_sgad/result.rb', line 20 def change_status self.state = self.result_valid? ? 1 : 0 self.save end |
#increase_amount ⇒ Object
enum result_type: NextSgad::Goal.goal_types
14 15 16 17 18 |
# File 'app/models/next_sgad/result.rb', line 14 def increase_amount employee_goal = self.employee_goal employee_goal.amount = employee_goal.amount + self.result_value employee_goal.save end |