Class: CreateAdminpanelTables
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateAdminpanelTables
- Defined in:
- lib/generators/adminpanel/initialize/templates/create_adminpanel_tables.rb
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/generators/adminpanel/initialize/templates/create_adminpanel_tables.rb', line 13 def change create_users create_roles create_auths create_sections create_sectionfiles end |
#migrate(direction) ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/generators/adminpanel/initialize/templates/create_adminpanel_tables.rb', line 2 def migrate(direction) super # Create a default user if direction == :up && Rails.env.development? role = Adminpanel::Role.new(:name => "Admin") role.save Adminpanel::User.new(:email => '[email protected]', :name => "Admin", :password => 'password', :password_confirmation => 'password', :role_id => role.id).save puts "The password for [email protected] is: password" end end |