From 0f4fc2d1cee094c697f40cbd2d3cca4f88717cd5 Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Wed, 11 Aug 2010 10:02:08 +1200 Subject: Helps when you use the RefinerySetting library properly. This is even sadder when you wrote most of it and then forgot. --- app/controllers/admin/blog/settings_controller.rb | 2 +- app/models/blog_comment.rb | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/controllers/admin/blog/settings_controller.rb b/app/controllers/admin/blog/settings_controller.rb index 9648688..52a7e83 100644 --- a/app/controllers/admin/blog/settings_controller.rb +++ b/app/controllers/admin/blog/settings_controller.rb @@ -1,7 +1,7 @@ class Admin::Blog::SettingsController < Admin::BaseController def notification_recipients - @recipients = BlogComment::Notification.recipients['value'] + @recipients = BlogComment::Notification.recipients if request.post? BlogComment::Notification.recipients == params[:recipients] diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb index 04651fe..5718295 100644 --- a/app/models/blog_comment.rb +++ b/app/models/blog_comment.rb @@ -10,10 +10,7 @@ class BlogComment < ActiveRecord::Base module Moderation class << self def enabled? - RefinerySetting.find_or_set(:comment_moderation, { - :value => true, - :scoping => :blog - }) + RefinerySetting.find_or_set(:comment_moderation, true, {:scoping => :blog}) end def toggle @@ -25,10 +22,9 @@ class BlogComment < ActiveRecord::Base module Notification class << self def recipients - RefinerySetting.find_or_set(:comment_notification_recipients, { - :value => (Role[:refinery].users.first.email rescue ''), - :scoping => :blog - }) + RefinerySetting.find_or_set( + :comment_notification_recipients, (Role[:refinery].users.first.email rescue ''), {:scoping => :blog} + ) end def recipients=(emails) -- cgit v1.2.3