Sha256: 700898556a2831f849080311c92b4f64337280a63fc085aa40215e2099329533

Contents?: true

Size: 689 Bytes

Versions: 60

Compression:

Stored size: 689 Bytes

Contents

class InsertAdminUserAndRoles < ActiveRecord::Migration
  def self.up
    Role.create(:name=>"Super")
    Role.create(:name=>"Admin")
    Role.create(:name=>"User")
    user = User.create(:email=>"<%= user_email %>",
                :password=>"<%= user_password %>",
                :confirmed_at=>DateTime::now,
                :role=>:super)
    Profile.create(
      :first_name => "<%= user_first_name %>",
      :last_name => "<%= user_last_name %>",
      :blog_title => "<%= user_blog_title %>",
      :alias => "<%= user_alias %>",
      :user => user
      )
  end

  def self.down
    User.find_by_email("<%= user_email %>").destroy
    Role.all.each {|t| t.destroy}
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
wheels-0.1.30 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.28 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.27 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.25 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.24 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.23 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.22 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.21 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.20 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.19 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.18 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.17 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.16 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.15 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.14 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.13 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.12 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.10 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.9 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.8 db/migrate/0060_insert_admin_user_and_roles.rb