3 ms·
That's kind of the philosophy of Ruby though, and ActiveSupport by extension. Where it makes code clearer and more concise, or where it simplifies an often-use
by matthewmacleod 13y ago
That's kind of the philosophy of Ruby though, and ActiveSupport by extension.
Where it makes code clearer and more concise, or where it simplifies an often-used idiom, and where it outweighs the benefit of sticking to principles—as I believe it does here—then breaking those principles is acceptable, in languages where coding conventions support this.
- philwelch 13y agoI don't think `2.days.ago` makes code any clearer or appreciably more concise than, for instance, `Date.today - Date.days(2)` (or even, to meet you in the middle, `Date.today - 2.days`).