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!

Digging Into The Finder Object Pattern

The concept of “skinny controllers” and “fat models” is a fairly common one in Rails. But what happens when you need to construct complex queries that don’t really belong in a controller, but are too overwhelming for your model? The finder object pattern is an elegant solution for this problem, and this blog post digs into the rhyme and reason behind them.

Comments

Great pattern, thanks for posting! I think your point that scopes don’t really belong on the model because they don’t add any functionality is a valid one, and a good case for finder objects. I’ll look forward to trying this out.

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