Skip to content

Fix issue cannot create two files of the same type, even if the name is different#80

Merged
rwjblue merged 5 commits intoember-cli:masterfrom
Gaurav0:fix_cannot_create_two_files_same_type
Jul 27, 2015
Merged

Fix issue cannot create two files of the same type, even if the name is different#80
rwjblue merged 5 commits intoember-cli:masterfrom
Gaurav0:fix_cannot_create_two_files_same_type

Conversation

@Gaurav0
Copy link
Copy Markdown
Contributor

@Gaurav0 Gaurav0 commented Jul 24, 2015

Fixes issue #79

@stefanpenner
Copy link
Copy Markdown
Contributor

is it possible to add a regression test?

@Gaurav0
Copy link
Copy Markdown
Contributor Author

Gaurav0 commented Jul 24, 2015

@stefanpenner Yes, done.

@stefanpenner
Copy link
Copy Markdown
Contributor

wunderbar

Comment thread app/adapters/gist-file.js Outdated
Copy link
Copy Markdown
Member

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 (or buildProperties) to ember-cli service.
  • Move main logic out of generate into build, leaving generate as roughly return this.store.createRecord('gistFile', this.build(type));.
  • Update addNew action in gist/controller.js to call build, then prompt, then createRecord.

@Gaurav0
Copy link
Copy Markdown
Contributor Author

Gaurav0 commented Jul 26, 2015

@rwjblue How's this?

@Gaurav0 Gaurav0 closed this Jul 26, 2015
@Gaurav0 Gaurav0 reopened this Jul 26, 2015
@Gaurav0
Copy link
Copy Markdown
Contributor Author

Gaurav0 commented Jul 26, 2015

Above was just to get Travis to test this. Please review.

@rwjblue
Copy link
Copy Markdown
Member

rwjblue commented Jul 27, 2015

Looks good to me, thanks for working on this!

rwjblue added a commit that referenced this pull request Jul 27, 2015
…type

Fix issue cannot create two files of the same type, even if the name is different
@rwjblue rwjblue merged commit 149b1b0 into ember-cli:master Jul 27, 2015
@Gaurav0 Gaurav0 deleted the fix_cannot_create_two_files_same_type branch March 21, 2016 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants