Commit 4e35d6fc9ca1735ed4c8caee5d90942d848feb9d
1 parent
1c0fe316
Exists in
master
and in
28 other branches
ActionItem927: not listing blogs as recent content
Showing
2 changed files
with
10 additions
and
1 deletions
Show diff stats
app/models/article.rb
| ... | ... | @@ -102,7 +102,7 @@ class Article < ActiveRecord::Base |
| 102 | 102 | public_article = ? AND |
| 103 | 103 | published = ? AND |
| 104 | 104 | profiles.public_profile = ? AND |
| 105 | - ((articles.type != ? and articles.type != ?) OR articles.type is NULL)", true, true, true, true, 'UploadedFile', 'RssFeed' | |
| 105 | + ((articles.type != ? and articles.type != ? and articles.type != ?) OR articles.type is NULL)", true, true, true, true, 'UploadedFile', 'RssFeed', 'Blog' | |
| 106 | 106 | ], |
| 107 | 107 | :include => 'profile', |
| 108 | 108 | :order => 'articles.updated_at desc, articles.id desc' | ... | ... |
test/unit/article_test.rb
| ... | ... | @@ -217,6 +217,15 @@ class ArticleTest < Test::Unit::TestCase |
| 217 | 217 | assert_equal [ second ], Article.recent(nil) |
| 218 | 218 | end |
| 219 | 219 | |
| 220 | + should 'not show blog as recent' do | |
| 221 | + p = create_user('usr1').person | |
| 222 | + Article.destroy_all | |
| 223 | + first = Blog.create!(:profile => p, :name => 'my blog', :advertise => true) | |
| 224 | + second = p.articles.build(:name => 'second'); second.save! | |
| 225 | + | |
| 226 | + assert_equal [ second ], Article.recent(nil) | |
| 227 | + end | |
| 228 | + | |
| 220 | 229 | should 'require that subclasses define description' do |
| 221 | 230 | assert_raise NotImplementedError do |
| 222 | 231 | Article.description | ... | ... |