|
|
|
|
|
by vinceguidry
2583 days ago
|
|
As a counterpoint, I love ActiveRecord. It's a Swiss Army knife that's got pretty much everything you need, you just need to find the right tool and use it. What ActiveRecord isn't is discoverable. Which is to an extent understandable. Its domain is literally anything you could express in SQL. But you really can do anything you want with it, you just have to find the right abstraction. A tool I use a lot is to .to_sql which will show you the compiled SQL fragment in a debugging session. You can compose with bare SQL fragments and ActiveRecord even includes an intermediate library so that you can work at the relational algebra level if you want. It's not that ActiveRecord forces you to work a certain way. It just doesn't advertise all its features. |
|
Ryan Bigg wrote a great book about breaking away from AR in Rails called Exploding Rails[3]. It's a good read.
[0] http://sequel.jeremyevans.net/
[1] https://github.com/elixir-ecto/ecto
[2] https://rom-rb.org/5.0/learn/introduction/active-record/
[3] https://leanpub.com/explodingrails