summaryrefslogtreecommitdiff
path: root/users/app/controllers
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-01-17 16:28:52 +0100
committerAzul <azul@leap.se>2013-01-17 16:28:52 +0100
commit247a6f14db14543773beb1a1e96f2c335800eb82 (patch)
tree5cf0740eb4ffd3ec836c146ef6ab2fd2955ca4fb /users/app/controllers
parenta8ec73a0307924610023525786bb3a9eb8b173e1 (diff)
minor fixes to validation workflow
Diffstat (limited to 'users/app/controllers')
-rw-r--r--users/app/controllers/users_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb
index 79de630..75ae2da 100644
--- a/users/app/controllers/users_controller.rb
+++ b/users/app/controllers/users_controller.rb
@@ -33,9 +33,10 @@ class UsersController < ApplicationController
def update
@user.attributes = params[:user]
- @email_alias = @user.email_aliases.last
if @user.changed? and @user.save
flash[:notice] = t(:user_updated_successfully)
+ elsif !@user.email_aliases.last.valid?
+ @email_alias = @user.email_aliases.pop
end
respond_with @user, :location => edit_user_path(@user, :anchor => @anchor)
end