is there an event I can write some code for when a Rails appli开发者_C百科cation is first started? I want to make sure my administrator user exists whenever the app starts. I am using devise auth framework in case that helps.
It would be better to make a new user in seeds.rb
and run rake db:seed
before starting the application - that's what it's for.
You could probably make an initializer inside of config/initializers
. You have to make sure you load up devise first, though.
精彩评论