mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +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
|
def update
|
||||||
@habit = current_user.habits.find(params[:id])
|
@habit = current_user.habits.find(params[:id])
|
||||||
user_stats = params[:habit].delete('user_stats')
|
if (params[:habit][:user_stats])
|
||||||
@habit.user.update_attributes({:lvl => user_stats['lvl'], :exp => user_stats['exp'], :money => user_stats['money']})
|
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|
|
respond_to do |format|
|
||||||
if @habit.update_attributes(params[:habit])
|
if @habit.update_attributes(params[:habit])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue