Jakub Troszok
Jakub Troszok

Reputation: 103733

Where should I put SQL queries in Rails?

What is the best practice where should I put SQL queries in Rails?

Upvotes: 5

Views: 1249

Answers (2)

John Topley
John Topley

Reputation: 115342

You should put them in your models. You might want to investigate named scopes too.

Upvotes: 7

Sophie Alpert
Sophie Alpert

Reputation: 143134

Put everything model-related in the model. Period.

Upvotes: 8

Related Questions