summaryrefslogtreecommitdiff
path: root/app/controllers/groups
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-04-08 16:59:06 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-04-08 16:59:06 -0300
commit127119f2c4db9038a7f34d1cc73ae1ed19cf0b8d (patch)
treea5e82423044276edaeb3cc5bff6cca1fccce1ec8 /app/controllers/groups
parentd11288be9580633baa3b21b4c70a5fc01e53d094 (diff)
downloadgitlab-ce-127119f2c4db9038a7f34d1cc73ae1ed19cf0b8d.tar.gz
Simplify query to retrieve NotificationSetting on controllers
Diffstat (limited to 'app/controllers/groups')
-rw-r--r--app/controllers/groups/notification_settings_controller.rb2
1 files changed, 1 insertions, 1 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 }