Sha256: f979a983f4838552078d2e703198a2226bf5e6420da056d0577b29109a4b91b8
Contents?: true
Size: 1.02 KB
Versions: 3
Compression:
Stored size: 1.02 KB
Contents
# Application template recipe for the rails3_devise_wizard. Check for a newer version here: # https://github.com/fortuity/rails3_devise_wizard/blob/master/recipes/seed_database.rb after_bundler do say_wizard "SeedDatabase recipe running 'after bundler'" unless recipes.include? 'mongoid' run 'rake db:migrate' end if recipes.include? 'mongoid' append_file 'db/seeds.rb' do <<-FILE puts 'EMPTY THE MONGODB DATABASE' Mongoid.master.collections.reject { |c| c.name =~ /^system/}.each(&:drop) FILE end end if recipes.include? 'devise' # create a default user append_file 'db/seeds.rb' do <<-FILE puts 'SETTING UP DEFAULT USER LOGIN' user = User.create! :name => 'First User', :email => 'user@test.com', :password => 'please', :password_confirmation => 'please' puts 'New user created: ' << user.name FILE end end run 'rake db:seed' end __END__ name: SeedDatabase description: "Create a database seed file with a default user." author: fortuity category: other tags: [utilities, configuration]
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rails3_devise_wizard-0.3.2 | recipes/seed_database.rb |
rails3_devise_wizard-0.3.1 | recipes/seed_database.rb |
rails3_devise_wizard-0.2.8 | recipes/seed_database.rb |