Sha256: b517629bd369d8b8327fc2c6e61368fdefdc553e732025bb32ed568bc6835505

Contents?: true

Size: 358 Bytes

Versions: 3

Compression:

Stored size: 358 Bytes

Contents

user_params = {
  :username   => 'Username',
  :password   => 'Password',
  :first_name => 'First Name',
  :last_name  => 'Last Name',
  :email      => 'Email'
}.inject({}) do |h, (attr, name)|
  puts "#{name}:"
  print '> '
  h[attr] = STDIN.gets.chomp
  h
end

user_params[:password_confirmation] = user_params[:password]

Blogr::User.create!(user_params)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blogr-0.0.8 db/seeds.rb
blogr-0.0.7 db/seeds.rb
blogr-0.0.6 db/seeds.rb