From 04bb82c8b8cb3033c805ea5158b01c09284ac3db Mon Sep 17 00:00:00 2001 From: James Lopez Date: Thu, 15 Jun 2017 15:24:37 +0200 Subject: update preferences controller --- app/controllers/profiles/preferences_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/controllers/profiles') diff --git a/app/controllers/profiles/preferences_controller.rb b/app/controllers/profiles/preferences_controller.rb index 5414142e2df..6845256e9d8 100644 --- a/app/controllers/profiles/preferences_controller.rb +++ b/app/controllers/profiles/preferences_controller.rb @@ -6,7 +6,9 @@ class Profiles::PreferencesController < Profiles::ApplicationController def update begin - if @user.update_attributes(preferences_params) + result = Users::UpdateService.new(current_user, user, preferences_params).execute + + if result[:status] == :success flash[:notice] = 'Preferences saved.' else flash[:alert] = 'Failed to save preferences.' -- cgit v1.2.3