sexta-feira, 28 de fevereiro de 2014

Rails tips


posts = Post.all
tags = posts.tags
# That is really bad because Rails is doing too many queries in database, we can make it better:

posts = Post.find(:all, include: :tags) # Not too many queries in database, more performance

Nenhum comentário:

Postar um comentário

~le comentário