debian-mirror-gitlab/app/controllers/projects/notification_settings_controller.rb
2016-06-02 11:05:42 +05:30

16 lines
440 B
Ruby

class Projects::NotificationSettingsController < Projects::ApplicationController
before_action :authenticate_user!
def update
notification_setting = current_user.notification_settings_for(project)
saved = notification_setting.update_attributes(notification_setting_params)
render json: { saved: saved }
end
private
def notification_setting_params
params.require(:notification_setting).permit(:level)
end
end