-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
Match only set attributes #53
Comments
Hmmm .. that is a good point .. about partial matches. I think that the idea was only to provide exact match, and I never considered partial match because it was kind of difficult. I tried your code above and it did not actually work. If you can prove otherwise send me a test I can run? |
Yes, it is a big need. In most of the cases I don't want to set all fields. I have taken a look into this and it seems that the problem is hash.data = JSON.stringify(hash.data); line in ember-data. Mockjax can't match it partially (since it is a string), it means we can't do this: Just curious why ember data "stringifies" data object. JQuery can handle it... |
There may be a way around this .. I am going to try an experiment this weekend to see if I can get the partial match working.
I am thinking that sometimes you might want an exact match sometimes?? |
@danielspaniel I think if you can do |
Right .. I see what you mean .. just match as many attributes as you have. Ok .. will work on the partial match and let you know when I am done. |
@yratanov, this issue is now fixed in v0.9.5. Ie. you can now do partial matches. |
Hello!
Do you think we need match only attributes that are not null?
Current code for
handleCreate
is:I believe it will not work if model is
Post(title: 'Some title', body: 'Some body')
, handleCreate ismatch: {title: 'Some title'}
(let's say I don't care about body field here), it will match totitle: 'Some title', body: null
so my request will not be handled.This will fix the problem:
The text was updated successfully, but these errors were encountered: