aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2010-08-10 16:17:03 +1200
committerPhilip Arndt <parndt@gmail.com>2010-08-10 16:17:03 +1200
commita6b6a0da3477719e0109ad6175b16f04d37b2550 (patch)
tree3adf9305d598bb8764b24f30abb827dc6b64949e /app/models
parent2e2b8bc9ba728091a58b93af6d72a34d9707cba7 (diff)
downloadrefinerycms-blog-a6b6a0da3477719e0109ad6175b16f04d37b2550.tar.gz
refinerycms-blog-a6b6a0da3477719e0109ad6175b16f04d37b2550.tar.bz2
refinerycms-blog-a6b6a0da3477719e0109ad6175b16f04d37b2550.zip
Better settings, update notified has a form but doesn't yet work. Created script files but not using them yet.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/blog_comment.rb20
1 files changed, 17 insertions, 3 deletions
diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb
index aced256..04651fe 100644
--- a/app/models/blog_comment.rb
+++ b/app/models/blog_comment.rb
@@ -17,10 +17,24 @@ class BlogComment < ActiveRecord::Base
end
def toggle
- currently = self.enabled?
- RefinerySetting[:comment_moderation] = !currently
+ RefinerySetting[:comment_moderation] = !(currently = self.enabled?)
end
end
end
-end
+ module Notification
+ class << self
+ def recipients
+ RefinerySetting.find_or_set(:comment_notification_recipients, {
+ :value => (Role[:refinery].users.first.email rescue ''),
+ :scoping => :blog
+ })
+ end
+
+ def recipients=(emails)
+ RefinerySetting[:comment_notification_recipients] = emails
+ end
+ end
+ end
+
+end \ No newline at end of file