diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-04-08 16:59:06 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-04-08 16:59:06 -0300 |
commit | 127119f2c4db9038a7f34d1cc73ae1ed19cf0b8d (patch) | |
tree | a5e82423044276edaeb3cc5bff6cca1fccce1ec8 /app/controllers/groups | |
parent | d11288be9580633baa3b21b4c70a5fc01e53d094 (diff) | |
download | gitlab-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.rb | 2 |
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 } |