recipes/devise_recipe.rb in playmo-0.1.4 vs recipes/devise_recipe.rb in playmo-0.1.5
- old
+ new
@@ -143,11 +143,11 @@
end
CONTENT
end
# Create migration that adds name field to users table
- filename = "db/migrate/#{(Time.now - 3600).strftime("%Y%m%d%H%M%S")}_add_name_to_users.rb"
+ filename = "db/migrate/#{(Time.now).strftime("%Y%m%d%H%M%S")}_add_name_to_users.rb"
create_file filename, <<-CONTENT.gsub(/^ {12}/, '')
class AddNameToUsers < ActiveRecord::Migration
def change
add_column :users, :name, :string
@@ -157,20 +157,24 @@
end
# Create default user
append_to_file 'db/seeds.rb' do
<<-CONTENT.gsub(/^ {8}/, '')
- user = User.create!(
+ # Create users
+ user = User.new(
:email => 'johndoe@example.com',
:password => 'secret',
:password_confirmation => 'secret'
)
- user2 = User.create!(
+ user2 = User.new(
:email => 'annadoe@example.com',
:password => 'secret',
:password_confirmation => 'secret'
)
+
+ user.save!
+ user2.save!
CONTENT
end
end
end
\ No newline at end of file