StatusCode: Our Weekly Programming Newsletter. You're not just a Rubyist, you're a software developer, right? :-) Check out StatusCode Weekly, our language and architecture agnostic newsletter that covers the biggest news across the entire software development world.

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!

Scoped Associations in Rails

I’ve never thought that ActiveRecord associations could be used as scopes until last week. I couldn’t find a step-by-step explanation, so I did a quick write up about how one can scope associations in Rails.

Some benefits: 👀 Make your code much more readable (stylish, even) ✂ DRY things up ⚡️ Preload your scopes and remove your N+1 queries

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