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

query returns different types of models, instead of single specified one #258

Open
adezegher opened this issue Apr 30, 2020 · 2 comments
Open

Comments

@adezegher
Copy link

When executing a query for a specific model, the query can return a result with other models than specified.

Example:

Following is expected to only return models of type house but will actually return data of both models house and person:

this.store.query('house',  { filter: { title: {$regex: ".*"} } });

Models:

// app/models/house.js
import { attr } from '@ember-data/model';
import { Model } from 'ember-pouch';

export default class HouseModel extends Model {
  @attr('string') title;

}

// app/models/person.js
import { attr } from '@ember-data/model';
import { Model } from 'ember-pouch';

export default class PersonModel extends Model {
  @attr('string') title;
}

Environment

DEBUG: Ember           : 3.17.3
DEBUG: Ember Data      : 3.17.0
DEBUG: Ember Pouch     : 7.0.0
@adezegher adezegher changed the title query returns different types of models, instead of single one query returns different types of models, instead of single specified one Apr 30, 2020
adezegher pushed a commit to adezegher/ember-pouch that referenced this issue May 5, 2020
adezegher pushed a commit to adezegher/ember-pouch that referenced this issue May 5, 2020
adezegher pushed a commit to adezegher/ember-pouch that referenced this issue May 5, 2020
@backspace
Copy link
Collaborator

Thanks for pointing this out. Did you have any success with addressing this in these linked commits, @adezegher? It would be preferable to include a test for this any fix, too.

@adezegher
Copy link
Author

@backspace the fix in PR #260 worked fine for me. I got pulled into something else so never got to fully debug why the tests were failing.

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

No branches or pull requests

2 participants