-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes wrong path ref in devise confirmation template that would cause…
… user creation to blow up in seed
- Loading branch information
Showing
2 changed files
with
51 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|