mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-13 17:52:22 +00:00
small fix to update
This commit is contained in:
parent
2e10d26325
commit
c979d24dac
1 changed files with 4 additions and 2 deletions
|
|
@ -34,8 +34,10 @@ class HabitsController < ApplicationController
|
|||
|
||||
def update
|
||||
@habit = current_user.habits.find(params[:id])
|
||||
user_stats = params[:habit].delete('user_stats')
|
||||
@habit.user.update_attributes({:lvl => user_stats['lvl'], :exp => user_stats['exp'], :money => user_stats['money']})
|
||||
if (params[:habit][:user_stats])
|
||||
user_stats = params[:habit].delete('user_stats')
|
||||
@habit.user.update_attributes({:lvl => user_stats['lvl'], :exp => user_stats['exp'], :money => user_stats['money']})
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
if @habit.update_attributes(params[:habit])
|
||||
|
|
|
|||
Loading…
Reference in a new issue