4 ms·
And somewhat ironically Rails deprecated the particularly magical features like `find_by_name("Bob")` aliases in favour of saner variants like `find_by(name: "B
by jon-wood 8y ago
And somewhat ironically Rails deprecated the particularly magical features like `find_by_name("Bob")` aliases in favour of saner variants like `find_by(name: "Bob")`.
- always_good 8y agoWhat a great change. It always seemed ridiculous to put the lookup key and lookup value in two different places. Nice to see Rails reconsider these things I once thought it would never surrender.
- bobbyi_settv 8y agoRuby didn't have keyword arguments when they came up with the initial approach.
- always_good 8y agoThat's not why they did it. For example, they could've used maps: find_by name: "foo"