class Order < ActiveRecord::Base
enum :status, { pending: 0, paid: 1, shipped: 2, refunded: 3 }
def shippable?
paid? && !refunded?
end
end
Bit off-topic but if `:status` is an enum, then `paid? && !refunded?` is equivalent to `paid?`
WesolyKubeczek•1h ago
> The title was bait to get you to open this article. But
Closes the article
dmix•1h ago
tessierashpool•56m ago
first, if somebody tries to cheat you, and you walk away, that's just not what losing looks like. that's the right move.
second, no, it's not good. it opens with clickbait, pivots to some other topic, so the first question is "what is it really about?"
they don't tell you what it's really about. they make you read the whole article to find out.
even if you're willing to accept people acting in bad faith, you still need to be able to assess if the article's worth reading. the only signal on that topic is the disrespect they showed to your normal process for doing so.
it would have been easy to fix with "here's what the article is about, and why the hyperbole almost works:" followed by a sentence which did that job.
they don't do that. instead they introduce a character without explaining who he is, so you have to click a link to find out (but again, no signal as to whether or not you should care). then you get a whole bunch of intricate code specifics, again without any signal about why you should care.
it's a very consistent theme. you're not going to get a good article out of an experience where you have to click external links and go several paragraphs deep just before learning "it's probably still going to be about enums" and "these people have no respect for either my time or the general principle that writing should be clear."
dmix•41m ago
Drive-by HN commenters always obsess about accuracy of headlines, I prefer reading the actual articles and judging it on that. I read the whole thing and it discussed some difficult open source work they are doing on Ruby in a way that kept my attention, shrug.
pitched•39m ago
Also Aaron is on the Rails Core team and probably colleague of the author at Shopify. Sam is also a colleague of the author at Shopify. The target audience of this article is people deep in that same culture and definitely not you.