Skip to content
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

Correct import of Ember Data model blueprint #131

Merged
merged 1 commit into from
Aug 30, 2016

Conversation

backspace
Copy link
Collaborator

As suggested by @fsmanuel, this fixes @fredguth’s error generating a model.

I’m not sure how this fix should affect the version number. Or maybe some kind of dual import should happen, to keep backward compatibility. Thoughts?

For now, @fredguth, you could just edit node_modules/ember-pouch/blueprints/pouch-model/index.js with this change and you’d be able to generate the model.

@fsmanuel
Copy link
Collaborator

@backspace nice! what you can do is wrap the require in a try catch:

var ModelBlueprint;

try {
  ModelBlueprint = require('ember-data/blueprints/model');
} catch (e) {
  ModelBlueprint = require('ember-cli/blueprints/model');
}

module.exports = ModelBlueprint;

so we have a fallback to ember-cli.

@backspace
Copy link
Collaborator Author

Oh yes, good idea @fsmanuel, thanks. I rewrote the commit with that solution.

@fsmanuel
Copy link
Collaborator

👍

@simonexmachina
Copy link
Collaborator

@backspace and @nolanlawson: is there any reason this shouldn't be merged already? Looks like a straighforward bug-fix and patch release to me.

@broerse broerse merged commit 8e7586e into pouchdb-community:master Aug 30, 2016
simonexmachina pushed a commit to simonexmachina/ember-pouch that referenced this pull request Sep 23, 2016
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.

ember-cli deprecation warning: overriding init without calling this.super
4 participants