]> source.dussan.org Git - redmine.git/commitdiff
Fixed: Project#enabled_module_names= does not test if a module is already enabled...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 13 Nov 2009 17:50:21 +0000 (17:50 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 13 Nov 2009 17:50:21 +0000 (17:50 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3036 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/project.rb

index b97d365e50b2752d7543518f463451e78fb73aad..42387c2d2e3f2b75d5d2609e14b4be3e74bb5722 100644 (file)
@@ -389,7 +389,7 @@ class Project < ActiveRecord::Base
       # remove disabled modules
       enabled_modules.each {|mod| mod.destroy unless module_names.include?(mod.name)}
       # add new modules
-      module_names.each {|name| enabled_modules << EnabledModule.new(:name => name)}
+      module_names.reject {|name| module_enabled?(name)}.each {|name| enabled_modules << EnabledModule.new(:name => name)}
     else
       enabled_modules.clear
     end