Skip to content

Commit

Permalink
cleaned up enabled_module patch
Browse files Browse the repository at this point in the history
  • Loading branch information
kikito committed Dec 17, 2011
1 parent 330aea2 commit 663511f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/redmine_sympa/patches/enabled_module_patch.rb
Expand Up @@ -5,7 +5,6 @@ module Patches
module EnabledModulePatch
def self.included(base)
base.send(:include, InstanceMethods)
base.extend(ClassMethods)
base.class_eval do
unloadable # Send unloadable so it will not be unloaded in development

Expand All @@ -14,23 +13,19 @@ def self.included(base)
end
end


module ClassMethods
end

module InstanceMethods
def is_a_sympa_module?
return (self.name == 'sympa_mailing_list' ? true : false)
end

def sympa_enable_module
self.reload
if(self.is_a_sympa_module?)
RedmineSympa::SympaLogger.info("EnabledModule: Project #{self.project.identifier} needs a new mailing list. We must registers all its users, too.")
RedmineSympa::Actions.create_list(project)
end
end

def sympa_disable_module
if(self.is_a_sympa_module?)
RedmineSympa::SympaLogger.info("EnabledModule: Project #{self.project.identifier} doesn't need a mailing list any more")
Expand Down

0 comments on commit 663511f

Please sign in to comment.