diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-06-17 18:38:49 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-06-17 20:29:11 +0300 |
commit | e5aa902860fcc2380fd25a6a4f0736dae159eba3 (patch) | |
tree | ba3c678a476bc7153490da412ebd64223c155c1c /app/controllers/notification_settings_controller.rb | |
parent | ab236c76247d83c190b148acbffa48f244414553 (diff) | |
parent | ae4491b42181f7195199fd6ac9273891d6e48263 (diff) |
Merge master into issue_12758
Diffstat (limited to 'app/controllers/notification_settings_controller.rb')
-rw-r--r-- | app/controllers/notification_settings_controller.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/app/controllers/notification_settings_controller.rb b/app/controllers/notification_settings_controller.rb index acda174c229..eddd03cc229 100644 --- a/app/controllers/notification_settings_controller.rb +++ b/app/controllers/notification_settings_controller.rb @@ -4,14 +4,12 @@ class NotificationSettingsController < ApplicationController def create project = Project.find(params[:project][:id]) - if can?(current_user, :read_project, project) - @notification_setting = current_user.notification_settings_for(project) - @saved = @notification_setting.update_attributes(notification_setting_params) - - render_response - else - render_404 - end + return render_404 unless can?(current_user, :read_project, project) + + @notification_setting = current_user.notification_settings_for(project) + @saved = @notification_setting.update_attributes(notification_setting_params) + + render_response end def update @@ -25,7 +23,7 @@ class NotificationSettingsController < ApplicationController def render_response render json: { - html: view_to_html_string("shared/notifications/buttons/_button", notification_setting: @notification_setting), + html: view_to_html_string("shared/notifications/_button", notification_setting: @notification_setting), saved: @saved } end |