fuel / oil

Fuel PHP Framework - Fuel v1.x Oil command-line package
http://fuelphp.com/docs/packages/oil/intro.html
106 stars 67 forks source link

"oil g scaffold ... --orm" creates models extending Model_Crud, not ORM #88

Closed fireappleblack closed 12 years ago

fireappleblack commented 12 years ago

I'm using Fuelphp 1.1dev branch.

When oil creates a model with the "--orm" switch, the model is created referencing Model\orm as expected.

When oil generates a model as part of the "scaffold" process, the "--orm" switch is ignored, and resultant models will reference Model_Crud instead. This occurs even if the model has already been successfully created referencing Model\orm prior to the scaffolding command.

E.g. oil g model foo title:varchar[50] body:text user_id:int --orm

generates a "foo" model using Model\orm as expected.

Then running: php oil g scaffold --orm foo title:varchar[50] body:text user_id:int

throws the expected error: Error: /..PATH.../fuel/app/classes/model/foo.php already exists, use -f or --force to override.

Forcing the override just overwrites the ORM model with a CRUD model

Reference in forums: http://fuelphp.com/forums/topics/view/6082#6478

WanWizard commented 12 years ago

As to your first remark: oil is not aware of previous activities, it just generates files.

And I can't reproduce this. "php oil g scaffold --orm ..." generates an ORM model just fine here. And I can't find any comments the last few weeks that may have fixed this, so for the moment, I'll close this as invalid.

fireappleblack commented 12 years ago

Didn't expect it to be aware of previous activities; was clutching at straws by then. Anyway, I'll clean out my MAMP stack and try the whole thing from scratch to be sure I've killed the problem for good and always. In other news; the application's growing nicely now (even without ORM scaffolding; just had to try a bit harder), and fuel is proving very useful. Thanks for all the effort, and a Happy New Year.