From 894dd55de27a0c6b8359f12a0439e8e59deb354e Mon Sep 17 00:00:00 2001 From: Gleb Rysev <gr00314@surrey.ac.uk> Date: Sat, 15 May 2021 13:40:56 +0100 Subject: [PATCH] GoalType fix --- app/helpers/goals_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/goals_helper.rb b/app/helpers/goals_helper.rb index d876977..4738e44 100644 --- a/app/helpers/goals_helper.rb +++ b/app/helpers/goals_helper.rb @@ -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 -- GitLab