From 28f0b5ce4ab4324c0657a25bb85b04c5fceef015 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 13 Nov 2009 17:50:21 +0000 Subject: [PATCH] Fixed: Project#enabled_module_names= does not test if a module is already enabled (#4200). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3036 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/project.rb b/app/models/project.rb index b97d365e5..42387c2d2 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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 -- 2.39.5