Commit 36f9dc488d8f7a1359542d761ff56b41991e6bee

Authored by Braulio Bhavamitra
1 parent 3ce46bb6

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,12 +262,12 @@ class Article < ActiveRecord::Base
262 262
263 scope :is_public, -> { 263 scope :is_public, -> {
264 joins(:profile). 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 scope :more_recent, -> { 268 scope :more_recent, -> {
269 order('articles.published_at desc, articles.id desc') 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 ((articles.type != ?) OR articles.type is NULL)", 271 ((articles.type != ?) OR articles.type is NULL)",
272 true, true, true, true, 'RssFeed') 272 true, true, true, true, 'RssFeed')
273 } 273 }