-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
Default arguments if fails
#226
Comments
Though it's weird that it doesn't work for me, cause CoffeeScript does support destructuring assignment and after compilation it must be just as passing plain object into a function with such arguments. Maybe that's babel that takes that stuff off on transpiling? |
hm .. that is kind of a bummer because me like that es6 notation alot. |
Well, you're the owner of this lib, so that's your call :) I can explicitly set properties in such cases, which actually I did when figured out the problem, but other users can run into this issue as well, that's my main concern. So it can be told somewhere in documentation, as an easiest option. I like that shiny ES6 features too, and if they were there when I started using Coffee, may be I wouldn't :) And to be honest, that should work just fine, as exactly the same notation of destructuring arguments assignment was in CS before, so maybe it's something tiny that could be fixed easily. |
I agree though about everything. It should work for coffeescript users .. I am sure that is a bug somewhere in the chain of happenings ( babel to coffee compilers ) .. so, yes I will fix it .. |
We can help with that if you want. Also I have couple of ideas, for one of which my mate is going to make a PR by tomorrow. |
Now your talking bro .. I'll take the help .. I am a bit overstretched these days .. and this kind of fix is pretty swift and painless |
Deal. Will prepare a PR soon |
how are things going with the pr .. need any help ? |
Sorry, been pretty busy. Will try to get to this soon! Thanks for #231 btw! 👍 👍 👍 |
I think I need your comment on this one: Who said that update errors don't need conversion? :-\ Now I'm puzzled too... I don't understand the reason of overriding this method. |
I think I ran the tests and I needed to have that override ( which puzzled me ). But if things now work without it .. be my guess and blow that away. |
So that means there's somewhere in the tests wrong expectation? Anyways, lemme check that. |
Oh, I see... So to fix that we either have to pass But there's another problem, I thought that |
The errors end up json-api style in the end anyway ( as I recall ) |
If that's the case, why do we need option at all? But I'm not sure about that. As I recall, there was a difference... I have to run right now, but will research and be back soon. As for PR, I think it's safe to merge right now. That error treating thing is not really related. |
So you were right, that internally the errors become the same json-api style, but what is generated by back-end is different: Also, I found there are convenience methods provided by ember-data, that could be used instead of own implementation here: And methods are here: |
You want to take a shot at changing from my impementation to the ember-data one? |
Yeah, I can do that, but it's again just a part of the story. You need to decide what to do with this whole errors handling thing. My understanding is that errors should be provided in general way and then converted per adaptor, so that option |
Oh, and json-api declares format for batching the errors, like shown here: |
your right .. i think response could be changed to just errors |
Alright, let me prepare a PR for this |
thanks for the attention to detail and yes, if we can support batch errors that would be nice |
Actually, I think we could do something neater... I just quickly read that #215 issue and figured, why don't we leave response as something RAW that could be provided by the user. For example, using meta in error response seems weird for me, but if someone needs that, they can supply response and it'll be passed as is. But if you supply errors parameter, it'll be converted respectively to adapter. |
The same for status code, usually it's just 422, so if we talk about field errors, that could be set automatically. Anyways, I'll think a bit about it and be back with PR. |
true about 422, and that sounded ok about the errors/meta thing. I think your on the right track so just go nuts and see what happens. |
still there @youroff .. ? |
Yeah, was buried by more urgent tasks. If open issue bothers you, let's close it for now and I'll return to it when I have a chance. |
I am not really bothered by open issue. Just be nice to get it out of the way, since things are always changing and it is harder to finish it ( without merge issues ) when a PR sits too long. If you want me to help out, let me know. I have time to work on it. |
We just ran into an issue with |
Ok .. sure thing, and as I said, I am happy to pitch in and help finish. |
Not sure if that's a problem of CoffeeScript which we use, or just something general, but when we use something like:
It takes convertErrors as false. So I guess it's some issue with the args notation here:
https://github.com/danielspaniel/ember-data-factory-guy/blob/master/addon/mocks/mock-request.js#L43
Might worth rewriting it good 'ol way to support CoffeeScript users.
The text was updated successfully, but these errors were encountered: