Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Root825995yIn Rails 4, `render text: "blah"` renders "blah" like you'd expect. In Rails 5, it renders ABSOLUTELY NOTHING BUT AN EMPTY BODY. You must instead use `render plain: "blah"` -- but there are no deprecation warnings or anything.
I wasted an hour debugging my test case for this, thinking the routing, my test, my factories, or my almost complete refactoring were to blame. AN HOUR OF MY LIFE. ASDFJKLSFASJF. -
Getting popcorn now. This should be fun!
Also - add versions in the request headers to redirect old traffic to old handlers. That return "upgrade damnit!" -
Root825995y@magicMirror I've never done that before, but it would be wonderful. I'll see if it's possible with Rails.
-
Condor324965yDoes the 0.01% of Android <4 users really justify lowering your target Android API level that much though? I'd argue with whoever made that decision that losing those users is probably for the best in every way possible anyway.
And, I mean, wasn't there also that requirement in Google I/O earlier that now all applications have to target the modern API levels? 26 if memory serves me right. -
Root825995y@frickerg I've been writing tests. I'm up to 86% coverage! 😄
The APIs here are decent. Not great, but considering my last foray into API Hell (thanks to API Guy), these are positively wonderful!
Related Rants
tl;dr @Root refactors some spaghetti.
I'm refactoring an api that creates a support message. It's a post route.
When seeing a magic hardcoded message string, this route instead updates the user object, and does not create a support message.
It also returns different results if the user is muted (fine) or if saving the message succeeds or fails (fine).
But if the user is creating a duplicate message, it doesn't save the message (fine) and... redirects to listing their messages instead? Wat?
Also, when refactoring this (migrating to a new message backend), I discovered that not all routes return a response. If the message is a non-duplicate, from a non-muted player, from a non-redacted client, the route doesn't respond at all!
So, I'm having fun cleaning this up. I actually am. Except I'll need to support all of the legacy clients for the next lifetime or two. I mean, really. There are still people with Android v2 devices who are using this thing. not even kidding.
rant
http 307: here's your inbox!
spaghetti
refactoring