4 ms·
Haha. Genuine question - why are nth methods available in ActiveRecord? Basically anything past .first doesn't seem necessary (functionally speaking).
by mbesto 12y ago
Haha. Genuine question - why are nth methods available in ActiveRecord? Basically anything past .first doesn't seem necessary (functionally speaking).
- mrweasel 12y agoI don't know, I'm not a Ruby/Rails guy. I just remember seeing something where DHH talked about this.
- mackwic 12y agoIt's the whole philosophy of ruby: sometimes, it makes more sense to write the index in full letters rather than in digits.
- briandear 12y agoI feel the same way about empty parenthesis and line ending semicolons. Lol.
- ghayes 12y agoFor me, it comes up in test cases. In a controlled environment, it can be nice to mentally say "add two objects, the first should be this, the second should be this." I don't think I've ever used `second` outside of the testing realm.