How can you plug complex, multi-model SQL queries into ActiveRecord models so that you can use them in your views?

Read more at the source