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

Change access to db property to use Ember.get #84

Merged
merged 1 commit into from
Jul 29, 2015

Conversation

jkleinsc
Copy link
Collaborator

Right now in the ember adapter, the code is using this.db to reference the PouchDB used. For most use cases this works fine, but it doesn't work if you are trying to set the db via injection doing something like this:

var configDB = new PouchDB('config');
application.register('pouchdb:configdb', configDB, {instantiate: false});
application.inject('adapter', 'db', 'pouchdb:configdb');  

In the example above this.db will be undefined, but this.get('db') will return the defined PouchDB.

This pull request simply changes the this.db references to this.get('db') so that the PouchDB can be injected or can be used the way it is defined in the readme.

@rsutphin
Copy link
Collaborator

@jkleinsc, thanks for this. It's a good idea. Can you rebase to get rid of that merge commit? If not I'll take care of it in the next few days.

…cted

Using this.db doesn’t work when injecting a PouchDB into the adapter.
In the case of an injected property, you need to use this.get(‘db’).
@jkleinsc
Copy link
Collaborator Author

@rsutphin I rebased and got rid of the merge commit. Thanks!

rsutphin added a commit that referenced this pull request Jul 29, 2015
Change access to db property to use Ember.get
@rsutphin rsutphin merged commit 202d0b5 into pouchdb-community:master Jul 29, 2015
@rsutphin
Copy link
Collaborator

Thanks!

@rsutphin
Copy link
Collaborator

Released as 2.0.3.

rsutphin added a commit that referenced this pull request Jul 30, 2015
@nolanlawson
Copy link
Member

👍, thanks for the PR! :)

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