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.7 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.6 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.5 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.4 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.3 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.2 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.1 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.1.0 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.0.49 db/migrate/0060_insert_admin_user_and_roles.rb
wheels-0.0.48 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.47 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.46 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.45 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.44 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.43 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.42 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.41 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.40 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.39 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.38 db/migrate/insert_admin_user_and_roles.rb