From 6212e60f9e4d144f9a136f6c82b33abd47ddb237 Mon Sep 17 00:00:00 2001 From: Jamie Winsor Date: Fri, 2 Sep 2011 16:01:58 -0700 Subject: 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 --- app/models/refinery/blog_comment.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/models/refinery/blog_comment.rb') diff --git a/app/models/refinery/blog_comment.rb b/app/models/refinery/blog_comment.rb index e5869a8..f7c1c84 100644 --- a/app/models/refinery/blog_comment.rb +++ b/app/models/refinery/blog_comment.rb @@ -19,6 +19,8 @@ module Refinery scope :unmoderated, :conditions => {:state => nil} scope :approved, :conditions => {:state => 'approved'} scope :rejected, :conditions => {:state => 'rejected'} + + self.per_page = Setting.find_or_set(:blog_comments_per_page, 10) def avatar_url(options = {}) options = {:size => 60} @@ -55,7 +57,7 @@ module Refinery end before_create do |comment| - unless BlogComment::Moderation.enabled? + unless Moderation.enabled? comment.state = comment.ham? ? 'approved' : 'rejected' end end -- cgit v1.2.3