With Rails, you can call `relation.map(&:id)` and `relation.pluck(:id)` and get the same thing — an array of `id`. But using map is 50x slower because it loads the entire model into memory (ActiveModel is very expensive) before enumerating; pluck fires a query and hits the result set from ActiveRecord — very inexpensive!
Average ability participants then fall for this foot gun (and others like it) and end up designing things poorly. One overlook quickly turns into accelerant at scale. This isn't unique to Rails, but Ruby — the delight that it is — makes it almost too trivial to do.
I've seen this happen at Rails shops many of us have an account on, where I wouldn't consider the people I worked with average ability participants either.
Which is to say, there’s a lot of ways to do things, and trade offs between the different ways, but isn’t that the case with any library or framework?
Sure – if – that's fine and optimal! In larger apps, where there's more complexity, there are so many paths that aren't that trivial and that's where the trouble begins.
You can do a similar performance issue with anything: here is a raw example: give to anyone a non-ORM framework and the chances of someone hitting multiple times the DB to query the same records increases with team size and app scope. I am not sure there is a framework that can protect your colleagues from doing select * and then count the in memory objects instead of doing a count on DB.
As far as Rails goes, for all it's shortcomings, people forget what web development was like in 2003. The dominant paradigms were overwrought XML-powered J2EE with incredibly low power-to-weight ratio for web development, or unstructured PHP wild west stuff. These days every language has a framework that was heavily influenced (directly or indirectly) by Rails. Sure I wouldn't use Rails everywhere (1000+ engineer team: java, lots of concurrency: elixir/erlang, lower-level large systems: go/rust, etc), but it still has a great sweet spot from the prototype to moderate sized web app / API. Things that become weaknesses as you scale (eg. ActiveRecord pattern) are based on contextual tradeoffs that need to be made thoughtfully versus declaring them table stakes for all web frameworks.