diff --git a/CHANGELOG.textile b/CHANGELOG.textile index fc64e546..148c99ba 100644 --- a/CHANGELOG.textile +++ b/CHANGELOG.textile @@ -1,5 +1,9 @@ h1. CHANGELOG +h2. 1.1.7 unreleased + +* improve 'devise' recipe for Devise 'confirmable' option + h2. 1.1.6 February 28, 2012 * update 'devise' recipe to accommmodate RSpec and Cucumber for Devise 'confirmable' option diff --git a/recipes/seed_database.rb b/recipes/seed_database.rb index 811e481d..08881286 100644 --- a/recipes/seed_database.rb +++ b/recipes/seed_database.rb @@ -27,20 +27,25 @@ end if recipes.include? 'devise' - # create a default user - append_file 'db/seeds.rb' do <<-FILE + if recipes.include? 'devise-confirmable' + append_file 'db/seeds.rb' do <<-FILE +puts 'SETTING UP DEFAULT USER LOGIN' +user = User.create! :name => 'First User', :email => 'user@example.com', :password => 'please', :password_confirmation => 'please', :confirmed_at => DateTime.now" +puts 'New user created: ' << user.name +FILE + end + else + append_file 'db/seeds.rb' do <<-FILE puts 'SETTING UP DEFAULT USER LOGIN' user = User.create! :name => 'First User', :email => 'user@example.com', :password => 'please', :password_confirmation => 'please' puts 'New user created: ' << user.name FILE - end - if recipes.include? 'devise-confirmable' - gsub_file 'db/seeds.rb', /:password_confirmation => 'please'/, ":password_confirmation => 'please', :confirmed_at => DateTime.now" + end end end - + run 'bundle exec rake db:seed' - + end __END__