Know what your scopes are doing: where.first vs find_by - Andy Croll
17-Mar-2022 1721
There are numerous benefits to using an Object-Relational Mapper (ORM), such as Active Record, to generate your SQL. You gain from clear repeatable abstractions, saving time and improving readability.Unfortunately the very abstractions that make an ORM useful can also have unintended consequences.It is very easy to introduce performance problems because the actual SQL that runs on your database server is generated by the framework, sometimes this means the SQL isn’t as efficient as it could be.
Know what your scopes are doing: where.first vs find_by - Andy Croll #ruby #rubydeveloper #rubyonrails #scopes #doing: #where.first #find_by #Croll https://rubyonrails.ba/link/know-what-your-scopes-are-doing-where-first-vs-find_by-andy-croll