RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

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

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in