Skip to content

Commit

Permalink
[padrino-admin] Fix an issue with skip_migrations and destroy.
Browse files Browse the repository at this point in the history
  • Loading branch information
DAddYE committed Sep 24, 2010
1 parent fc8901c commit 9479ba6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions padrino-admin/lib/padrino-admin/generators/admin_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ def create_admin
directory "templates/app", destination_root("admin")
directory "templates/assets", destination_root("public", "admin")

Padrino::Generators::Model.start([
account_params = [
"account", "name:string", "surname:string", "email:string", "crypted_password:string", "salt:string", "role:string",
"-r=#{options[:root]}", "-s=#{options[:skip_migration]}", "-d=#{options[:destroy]}"
])
"-r=#{options[:root]}"
]

account_params << "-s" if options[:skip_migration]
account_params << "-d" if options[:destroy]

Padrino::Generators::Model.start(account_params)

column = Struct.new(:name, :type)
columns = [:id, :name, :surname, :email].map { |col| column.new(col) }
Expand Down

0 comments on commit 9479ba6

Please sign in to comment.