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.0.37 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.36 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.35 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.34 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.33 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.32 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.31 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.30 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.29 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.28 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.27 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.26 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.25 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.24 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.23 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.22 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.21 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.20 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.19 db/migrate/insert_admin_user_and_roles.rb
wheels-0.0.18 db/migrate/insert_admin_user_and_roles.rb