Permalink
Browse files

blog updates (archive not to count draft pages) cache sweeper to home…

…page for people that have blog info on the homepage
  • Loading branch information...
1 parent d781313 commit 84f3dfb52a01eb7f97e34d19b666bb9460e926c5 @chrisftw chrisftw committed Mar 2, 2012
@@ -2,7 +2,7 @@ module Refinery
module Blog
module PostsHelper
def blog_archive_widget
- posts = Refinery::Blog::Post.select('published_at').all_previous
+ posts = Refinery::Blog::Post.live.select('published_at').all_previous
return nil if posts.blank?
deadline = Time.now.end_of_year.advance(:years => -3)
@@ -36,6 +36,9 @@ def expire_cache_for(record)
expire_fragment("blog_posts_index_#{i}")
#Rails.cache.delete("blog_post_list_page_#{i}")
end
+
+ #home_page
+ expire_fragment "pages/home"
end
end
@@ -1,7 +1,7 @@
<% content_for :title, "#{t('.blog_archive_for', :date => @archive_date.strftime('%B %Y'))}" %>
<% content_for :body_content_left do %>
- <% cache("archive_list") do %>
+ <%# cache("archive_list#{@archive_date.strftime('%B_%Y')}") do %>
<h1><%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %></h1>
<% if @posts.any? %>
<section id="blog_posts">
@@ -10,7 +10,7 @@
<% else %>
<p><%= t('.no_blog_articles_posted', :date => @archive_date.strftime('%B %Y')) %></p>
<% end %>
- <% end %>
+ <%# end %>
<% end %>
<%= render :partial => '/refinery/blog/shared/body_content_right' %>

0 comments on commit 84f3dfb

Please sign in to comment.