Permalink
Browse files

improve 'devise' recipe for Devise 'confirmable' option

  • Loading branch information...
1 parent 2cb22c3 commit b9218de9e90efcbe2d46bf251f4846f7d956240e @DanielKehoe DanielKehoe committed Mar 3, 2012
Showing with 16 additions and 7 deletions.
  1. +4 −0 CHANGELOG.textile
  2. +12 −7 recipes/seed_database.rb
View
@@ -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
View
@@ -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__

0 comments on commit b9218de

Please sign in to comment.