From fa2713e7cd09559a44f39772559117dbd96c3eb9 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Wed, 15 Jan 2014 13:40:02 +0000 Subject: [PATCH] plugin-spammable: reloading extension on each request on development mode --- lib/noosfero/plugin/spammable.rb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/noosfero/plugin/spammable.rb b/lib/noosfero/plugin/spammable.rb index 78d38a6..d220bd8 100644 --- a/lib/noosfero/plugin/spammable.rb +++ b/lib/noosfero/plugin/spammable.rb @@ -1,13 +1,15 @@ -Spammable.module_eval do - def marked_as_spam - plugins.dispatch(:marked_as_spam, self) - end +Rails.configuration.to_prepare do + Spammable.module_eval do + def marked_as_spam + plugins.dispatch(:marked_as_spam, self) + end - def marked_as_ham - plugins.dispatch(:marked_as_ham, self) - end + def marked_as_ham + plugins.dispatch(:marked_as_ham, self) + end - def check_for_spam - plugins.dispatch(:check_for_spam, self) + def check_for_spam + plugins.dispatch(:check_for_spam, self) + end end end -- libgit2 0.21.2