mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-04-14 19:47:03 +00:00
Deduct money if their checkbox was a mistake
This commit is contained in:
parent
82a343fa71
commit
95e52378d9
1 changed files with 2 additions and 2 deletions
|
|
@ -30,8 +30,8 @@ class Habit < ActiveRecord::Base
|
|||
|
||||
self.score += value
|
||||
|
||||
# also add money (we never take away money)
|
||||
if direction=='up'
|
||||
# also add money. Only take away money if it was a mistake (aka, a checkbox)
|
||||
if (direction=='up') || (direction=='down' && self.habit_type!=Habit::ALWAYS)
|
||||
self.user.money += value
|
||||
self.user.save
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue