AmpersandJS / ampersand

Quickest way to get started with ampersand.
MIT License
812 stars 41 forks source link

Modify model gen to use collectionfolder configuration value #118

Closed shmeeps closed 9 years ago

shmeeps commented 9 years ago

I've just started using AmpersandJS, but one of the things I've noticed is that by default, models and collections are generated in the same folder. In the readme, it is stated that the collectionfolder attribute can be used in the project configuration to specify the collection folder (model folder by default), but the generation doesn't appear to factor this in, nor does the attribute seem to be used anywhere in ampersand.

This change should factor in the collectionfolder attribute when creating the collection file, and the require path to the model inside of the collection source should automatically adapt relative to where the collection and model are placed. This could probably be done more gracefully, but this was a kind of quick change to assist with my organization preferences while generating models and collections.

fyockm commented 9 years ago

@shmeeps thanks for the PR! code review looks good, but need to run a few tests before merging.

fyockm commented 9 years ago

sorry for the delay. +1 from me. need one more before merging.

pgilad commented 9 years ago

+1

fyockm commented 9 years ago

thanks @pgilad for the review and thanks @shmeeps for submitting!