Skip to content
Snippets Groups Projects
Commit 894dd55d authored by Rysev, Gleb (UG - SISC)'s avatar Rysev, Gleb (UG - SISC)
Browse files

GoalType fix

parent 8eb5fa46
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ module GoalsHelper
end
def updateHabitAmountGoals
@goals = Goals.where(goalType: "habitAmount")
@goals = Goals.where(goaltype: "habitAmount")
amount = getHabitsAmount(current_user)
@goals.each do |goal|
......@@ -25,7 +25,7 @@ module GoalsHelper
# Updates streaks for goals
def updateHabitStreakGoals
@goals = Goals.where(goalType: "habitStreak").or(Goals.where(goalType: "monthlyHabitStreak"))
@goals = Goals.where(goaltype: "habitStreak").or(Goals.where(goaltype: "monthlyHabitStreak"))
@goals.each do |goal|
if Habit.exists?(goal.habit_id)
......@@ -109,7 +109,7 @@ module GoalsHelper
end
def deleteLastMonthsGoals
@goals = Goals.where(user_id: current_user.id, goalType: "monthlyHabitStreak", completed: "false")
@goals = Goals.where(user_id: current_user.id, goaltype: "monthlyHabitStreak", completed: "false")
if @goals.length > 0
@goals.each do |goal|
goal.destroy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment