Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Padrino Plugin Generator Templates produce wrong output with underscores #924
I'm using the latest copy of Padrino and I'm running into a multitude of problems building independent-sub applications to be installed to a currently existing application. In particular, the generators are creating the wrong things when underscores are used. The normal project files are contained under the name without the underscore, and the model files are stored in the folder with an underscore.
Try this on for size:
project orm: 'datamapper', test: 'cucumber', script: 'dojo', renderer: 'haml', stylesheet: 'scss' run_bundler app :general_ledger do generate :model, 'ledger name:string description:text' generate :model, 'chart_of_accounts name:string description:text' generate :model, 'account_group name:string description:text chart_of_accounts_id' generate :model, 'account_type name:string description:text' generate :model, 'account name:string description:text account_type_id:integer account_group_id:integer' end rake 'dm:auto:upgrade'
Ideally, I should be able to pick up the app..end and place it into its own file, and then simply create a sub-application using this. However this is being hindered by the underscore problem.
Here is my command prompt output:
I can confirm this with even fewer steps:
padrino g project foo -d datamapper cd foo padrino g app blog padrino g model --app=blog posts title content
O.K., so I discussed this with @skade today. The reason why this is failing is because the model generator doesn't automatically assume "String" as default datatype (or any really). So @jamespedid and I made the same mistake and assumed String would be the default datatype chosen if none is given.
That being figured out, I think the generator should either not fail that hard and print out a proper text message or do it like Rails and assume "String" as the default datatype.