Ok, I\'m probably going to feel quite dumb when someone answers this one with a simple thing that I\'m missing but... here goes:
I\'ve got a brand new app on rails 3
This may not apply to Devise (but I believe it will), but in general if you want to seed an admin user but don't want to store your admin password in source control, you can do something like this...
@user = User.find_by_email("admin@email.com")
unless @user
# We are going to bypass both our assignment protection and validation
# so we aren't storing the password in source control.
#
# This doesn't replace the need to change the password occasionaly, both
# on the site and in source control.
@user = User.create do |u|
u.name = "Admin User"
u.email = "admin@email.com"
u.password_digest = "$2a$10$DUv/IUiLB34jhi3j4Z8MwwcaDlBmFe3rvcdXSzPKLzBOAMmD53UqW"
end
@user.save(:validate => false)
# TODO make the user an admin
end
You can create the user locally with the password you want to find the password_digest.