diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-08-29 22:44:45 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-08-29 22:44:45 +0400 |
commit | 07f156f5c2c6776079f0210f4067121d1b74048d (patch) | |
tree | c7ad23dc52132a23bcd5e845283aa7077115b516 /app/observers | |
parent | 3d41e182c2051d539006107df9ece42b947100c2 (diff) |
Dont update namespace if User name was changed. Use user#username for namespace name because Namespace#name validates by uniq
Diffstat (limited to 'app/observers')
-rw-r--r-- | app/observers/user_observer.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/observers/user_observer.rb b/app/observers/user_observer.rb index e969405a598..fba0f1006d9 100644 --- a/app/observers/user_observer.rb +++ b/app/observers/user_observer.rb @@ -13,8 +13,8 @@ class UserObserver < BaseObserver # Ensure user has namespace user.create_namespace!(path: user.username, name: user.username) unless user.namespace - if user.username_changed? || user.name_changed? - user.namespace.update_attributes(path: user.username, name: user.name) + if user.username_changed? + user.namespace.update_attributes(path: user.username, name: user.username) end end end |