-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue cannot create two files of the same type, even if the name is different #80
Fix issue cannot create two files of the same type, even if the name is different #80
Conversation
is it possible to add a regression test? |
@stefanpenner Yes, done. |
wunderbar |
generateIdForRecord: function(store, type, inputProperties) { | ||
return inputProperties.filePath.replace(/\//gi, '.'); | ||
return inputProperties.filePath.replace(/\//gi, '.') + "." + this.incrementProperty('seq'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of allowing duplicate filePath's, I think that we should delay calling store.createRecord
until after we have prompted for the file name.
We should:
- Add a
build
(orbuildProperties
) toember-cli
service. - Move main logic out of
generate
intobuild
, leavinggenerate
as roughlyreturn this.store.createRecord('gistFile', this.build(type));
. - Update
addNew
action ingist/controller.js
to callbuild
, then prompt, then createRecord.
@rwjblue How's this? |
Above was just to get Travis to test this. Please review. |
Looks good to me, thanks for working on this! |
…type Fix issue cannot create two files of the same type, even if the name is different
Fixes issue #79