Skip to content

Commit

Permalink
improve 'devise' recipe for Devise 'confirmable' option
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielKehoe committed Mar 3, 2012
1 parent 2cb22c3 commit b9218de
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.textile
@@ -1,5 +1,9 @@
h1. CHANGELOG h1. CHANGELOG


h2. 1.1.7 unreleased

* improve 'devise' recipe for Devise 'confirmable' option

h2. 1.1.6 February 28, 2012 h2. 1.1.6 February 28, 2012


* update 'devise' recipe to accommmodate RSpec and Cucumber for Devise 'confirmable' option * update 'devise' recipe to accommmodate RSpec and Cucumber for Devise 'confirmable' option
Expand Down
19 changes: 12 additions & 7 deletions recipes/seed_database.rb
Expand Up @@ -27,20 +27,25 @@
end end


if recipes.include? 'devise' if recipes.include? 'devise'
# create a default user if recipes.include? 'devise-confirmable'
append_file 'db/seeds.rb' do <<-FILE 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' puts 'SETTING UP DEFAULT USER LOGIN'
user = User.create! :name => 'First User', :email => 'user@example.com', :password => 'please', :password_confirmation => 'please' user = User.create! :name => 'First User', :email => 'user@example.com', :password => 'please', :password_confirmation => 'please'
puts 'New user created: ' << user.name puts 'New user created: ' << user.name
FILE FILE
end end
if recipes.include? 'devise-confirmable'
gsub_file 'db/seeds.rb', /:password_confirmation => 'please'/, ":password_confirmation => 'please', :confirmed_at => DateTime.now"
end end
end end

run 'bundle exec rake db:seed' run 'bundle exec rake db:seed'

end end


__END__ __END__
Expand Down

0 comments on commit b9218de

Please sign in to comment.