summaryrefslogtreecommitdiff
path: root/app/controllers/profiles
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2016-06-09 16:33:31 -0300
committerFelipe Artur <felipefac@gmail.com>2016-06-10 11:49:30 -0300
commit39ead205de72461e86db07525922f2fab5fff2a9 (patch)
tree5336487bad3b89b5db461788aba9eb7d4b9c3b0f /app/controllers/profiles
parent8f6d43e0fea3ce62ec2e8e211755e557f19c51fd (diff)
downloadgitlab-ce-39ead205de72461e86db07525922f2fab5fff2a9.tar.gz
Remove notification level fild from users, improve migrations and specsissue_3359_2
Diffstat (limited to 'app/controllers/profiles')
-rw-r--r--app/controllers/profiles/notifications_controller.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/app/controllers/profiles/notifications_controller.rb b/app/controllers/profiles/notifications_controller.rb
index 1e9ceb87857..40d1906a53f 100644
--- a/app/controllers/profiles/notifications_controller.rb
+++ b/app/controllers/profiles/notifications_controller.rb
@@ -17,21 +17,18 @@ class Profiles::NotificationsController < Profiles::ApplicationController
end
def user_params
- params.require(:user).permit(:notification_email, :notification_level)
+ params.require(:user).permit(:notification_email)
end
- def notification_params
- params.require(:notification_level)
+ def global_notification_setting_params
+ params.require(:global_notification_setting).permit(:level)
end
private
def update_notification_settings
- return true unless notification_params
+ return true unless global_notification_setting_params
- notification_setting = current_user.global_notification_setting
- notification_setting.level = notification_params
-
- notification_setting.save
+ current_user.global_notification_setting.update_attributes(global_notification_setting_params)
end
end