Skip to content

Commit

Permalink
fixes wrong path ref in devise confirmation template that would cause…
Browse files Browse the repository at this point in the history
… user creation to blow up in seed
  • Loading branch information
mkuhl committed Sep 22, 2011
1 parent 75e5388 commit 54f3375
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 52 deletions.
2 changes: 1 addition & 1 deletion app/views/devise/mailer/confirmation_instructions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

<p>You can confirm your account through the link below:</p>

<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
<p><%= link_to 'Confirm my account', user_confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
101 changes: 50 additions & 51 deletions db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,51 +1,50 @@
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)


# create some regular users
#
#["Hugo", "Otto", "Franz"].each do |uname|
# user = User.new email: "#{ uname }@testing.com",
# name: "#{uname}",
# password: 'testing',
# password_confirmation: 'testing'
#
#
# user.save rescue ActionView::Template::Error
# user.save
# user.confirm!
# puts "created user #{uname}"
#end
#
require 'factory_girl'
# Dir[Rails.root.join("spec/factories/*.rb")].each {|f| require f}

public
def make_user(user)
user.save rescue ActionView::Template::Error
user.save
user.confirm!
puts "created user #{user.name} (#{user.email})"

user
end

# create users
20.times do
make_user(Factory.build :user)
end
make_user(Factory.build :user, :name => 'mike', :email => 'meb@kuhl.at')
make_user(Factory.build :user, :name => 'admin', :email => 'mkuhl@softmachine.at')

# create posts
10.times do
post = Factory.build :blog_post
post.save
puts "created post #{post.title}"
end

# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)


# create some regular users
#
#["Hugo", "Otto", "Franz"].each do |uname|
# user = User.new email: "#{ uname }@testing.com",
# name: "#{uname}",
# password: 'testing',
# password_confirmation: 'testing'
#
#
# user.save rescue ActionView::Template::Error
# user.save
# user.confirm!
# puts "created user #{uname}"
#end
#
require 'factory_girl'
# Dir[Rails.root.join("spec/factories/*.rb")].each {|f| require f}

public
def make_user(user)
user.save
user.confirm!
puts "created user #{user.name} (#{user.email})"

user
end

# create users
20.times do
make_user(Factory.build :user)
end
make_user(Factory.build :user, :name => 'mike', :email => 'meb@kuhl.at')
make_user(Factory.build :user, :name => 'admin', :email => 'mkuhl@softmachine.at')

# create posts
10.times do
post = Factory.build :blog_post
post.save
puts "created post #{post.title}"
end

0 comments on commit 54f3375

Please sign in to comment.