Skip to content

Query Objects

Dany Marcoux edited this page Jul 13, 2021 · 5 revisions

Problem

A class has one or multiple complex SQL/ActiveRecord queries or scopes.

Solution

Extract those complex SQL/ActiveRecord queries or scopes to query objects located under src/api/app/queries. Those query objects are plain old Ruby objects (PORO), so they are easy to test and they can be reused if needed.

Details

Links:

Clone this wiki locally