index action of blog post controller now caches and sweeps on changes
fix various views which were broken and untested with rails-3-1 upgrade add request spec tests for admin blog comments Factory is now FactoryGirl Fix multiple issues around listing unmoderated comments use cleaner definitions to set per_page willpaginate attribute on models update all paginate calls to use new arel representation reorganize filter sections to be located at top of controller modify uncategorized class method to activerecord scope and perform a left outer join instead of iterate through an array to find uncategorized posts move request specs into their proper places update guardfile to ensure that request specs get run when their respective controllers are modified Fix show action for AdminBlogComments and added test Fix redirection link after approving or rejecting a comment
This commit is contained in:
parent
80ca7c1bf9
commit
6212e60f9e
20 changed files with 420 additions and 266 deletions
|
@ -1,6 +1,9 @@
|
|||
module Refinery
|
||||
module Blog
|
||||
class PostsController < BlogController
|
||||
|
||||
caches_page :index
|
||||
# cache_sweeper Refinery::BlogSweeper, :only => [:comment]
|
||||
|
||||
before_filter :find_all_blog_posts, :except => [:archive]
|
||||
before_filter :find_blog_post, :only => [:show, :comment, :update_nav]
|
||||
|
@ -38,10 +41,10 @@ module Refinery
|
|||
|
||||
if Refinery::BlogComment::Moderation.enabled?
|
||||
flash[:notice] = t('thank_you_moderated', :scope => 'blog.posts.comments')
|
||||
redirect_to blog_post_url(params[:id])
|
||||
redirect_to main_app.blog_post_url(params[:id])
|
||||
else
|
||||
flash[:notice] = t('thank_you', :scope => 'blog.posts.comments')
|
||||
redirect_to blog_post_url(params[:id],
|
||||
redirect_to main_app.blog_post_url(params[:id],
|
||||
:anchor => "comment-#{@blog_comment.to_param}")
|
||||
end
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue