Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed portlets that did not check for release flag

  • Loading branch information...
commit 339f789db69f7accb63a85d1a81fdc7bd223b41d 1 parent bf580a4
crh3675 crh3675 authored
4 app/portlets/news_archive_portlet.rb
View
@@ -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
4 app/portlets/recent_news_portlet.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.