summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/groups/notification_settings_controller.rb2
-rw-r--r--app/controllers/projects/notification_settings_controller.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/groups/notification_settings_controller.rb b/app/controllers/groups/notification_settings_controller.rb
index 78e43c83aba..20405a05190 100644
--- a/app/controllers/groups/notification_settings_controller.rb
+++ b/app/controllers/groups/notification_settings_controller.rb
@@ -1,6 +1,6 @@
class Groups::NotificationSettingsController < Groups::ApplicationController
def update
- notification_setting = group.notification_settings.where(user_id: current_user).find(params[:id])
+ notification_setting = group.notification_settings.find_by(user_id: current_user)
saved = notification_setting.update_attributes(notification_setting_params)
render json: { saved: saved }
diff --git a/app/controllers/projects/notification_settings_controller.rb b/app/controllers/projects/notification_settings_controller.rb
index 3ecf63d107f..da9034380af 100644
--- a/app/controllers/projects/notification_settings_controller.rb
+++ b/app/controllers/projects/notification_settings_controller.rb
@@ -8,7 +8,7 @@ class Projects::NotificationSettingsController < Projects::ApplicationController
end
def update
- notification_setting = project.notification_settings.where(user_id: current_user).find(params[:id])
+ notification_setting = project.notification_settings.find_by(user_id: current_user)
saved = notification_setting.update_attributes(notification_setting_params)
render json: { saved: saved }