lib/tasks/admin_user.rake in gaku_admin-0.1.1 vs lib/tasks/admin_user.rake in gaku_admin-0.2.0
- old
+ new
@@ -89,10 +89,11 @@
say "\nWARNING: There is already a user with the email: #{email}, so no account changes were made. If you wish to create an additional admin user, please run rake gaku:generate_admin again with a different email.\n\n"
elsif Gaku::User.find_by_username(username)
say "\nWARNING: There is already a user with the username: #{username}, so no account changes were made. If you wish to create an additional admin user, please run rake gaku:generate_admin again with a different username.\n\n"
else
say "Creating user..."
- admin = Gaku::User.create(attributes)
+ creator = Gaku::UserCreator.new(attributes).save
+ admin = creator.get_user
# create an admin role and and assign the admin user to that role
role = Gaku::Role.find_or_create_by_name 'Admin'
admin.roles << role
if admin.save
say "User Created"