diff --git a/app/helpers/goals_helper.rb b/app/helpers/goals_helper.rb index d87697798ba759657f6b0b437cf85f18f7fb0994..4738e44a65b75fadfd2a3ec567974ec40efc8ce2 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