Permalink
Browse files

fixed portlets that did not check for release flag

  • Loading branch information...
1 parent bf580a4 commit 339f789db69f7accb63a85d1a81fdc7bd223b41d @crh3675 crh3675 committed Jun 20, 2011
Showing with 4 additions and 4 deletions.
  1. +2 −2 app/portlets/news_archive_portlet.rb
  2. +2 −2 app/portlets/recent_news_portlet.rb
@@ -5,10 +5,10 @@ class NewsArchivePortlet < Portlet
def render
if self.category_id.blank?
- @articles = NewsArticle.all(:order => "release_date desc", :limit => self.limit)
+ @articles = NewsArticle.released.all(:order => "release_date desc", :limit => self.limit)
else
@category = Category.find(self.category_id)
- @articles = NewsArticle.all(:conditions => ["category_id = ?", @category.id], :order => "release_date desc", :limit => self.limit)
+ @articles = NewsArticle.released.all(:conditions => ["category_id = ?", @category.id], :order => "release_date desc", :limit => self.limit)
end
end
@@ -10,10 +10,10 @@ def render
end
if @portlet.category_id.blank?
- @articles = NewsArticle.all(:order => order, :limit => @portlet.limit)
+ @articles = NewsArticle.released.all(:order => order, :limit => @portlet.limit)
else
@category = Category.find(@portlet.category_id)
- @articles = NewsArticle.all(:conditions => ["category_id = ?", @category.id], :order => order, :limit => @portlet.limit)
+ @articles = NewsArticle.released.all(:conditions => ["category_id = ?", @category.id], :order => order, :limit => @portlet.limit)
end
end

0 comments on commit 339f789

Please sign in to comment.