Skip to content

Query Objects

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

Problem

A class has complex ActiveRecord queries/scopes.

Solution

Extract those complex ActiveRecord queries/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