How to change source for Active Model?
The nice thing about Active Record scopes is that you not only can specify where conditions. I recently had a need to run a query against a model to discover previous and next elements. This can be easily achieved using window functions. The trick was to change Active Model to use the query instead of the table.
Post a comment