Commit 36f9dc488d8f7a1359542d761ff56b41991e6bee
1 parent
3ce46bb6
Exists in
master
and in
20 other branches
articles: be specific in queries
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
app/models/article.rb
... | ... | @@ -262,12 +262,12 @@ class Article < ActiveRecord::Base |
262 | 262 | |
263 | 263 | scope :is_public, -> { |
264 | 264 | joins(:profile). |
265 | - where("advertise = ? AND published = ? AND profiles.visible = ? AND profiles.public_profile = ?", true, true, true, true) | |
265 | + where("articles.advertise = ? AND articles.published = ? AND profiles.visible = ? AND profiles.public_profile = ?", true, true, true, true) | |
266 | 266 | } |
267 | 267 | |
268 | 268 | scope :more_recent, -> { |
269 | 269 | order('articles.published_at desc, articles.id desc') |
270 | - .where("advertise = ? AND published = ? AND profiles.visible = ? AND profiles.public_profile = ? AND | |
270 | + .where("articles.advertise = ? AND articles.published = ? AND profiles.visible = ? AND profiles.public_profile = ? AND | |
271 | 271 | ((articles.type != ?) OR articles.type is NULL)", |
272 | 272 | true, true, true, true, 'RssFeed') |
273 | 273 | } | ... | ... |