Fixed and improved enable_naamespace migration task

This commit is contained in:
Dmitriy Zaporozhets 2012-12-28 06:14:05 +03:00
parent d991ce636b
commit d03964d6ec
3 changed files with 76 additions and 27 deletions

View file

@ -14,7 +14,7 @@ class UserObserver < ActiveRecord::Observer
if user.namespace
user.namespace.update_attributes(path: user.username)
else
user.create_namespace!(path: user.username, name: user.name)
user.create_namespace!(path: user.username, name: user.username)
end
end
end