diff --git a/app/models/project.rb b/app/models/project.rb
index 29a750f..a6119d2 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -510,9 +510,9 @@ class Project < ActiveRecord::Base
     if module_names && module_names.is_a?(Array)
       module_names = module_names.collect(&:to_s).reject(&:blank?)
       # remove disabled modules
-      enabled_modules.each {|mod| mod.destroy unless module_names.include?(mod.name)}
+      enabled_modules.each {|mod| disable_module!(mod) unless module_names.include?(mod.name)}
       # add new modules
-      module_names.reject {|name| module_enabled?(name)}.each {|name| enabled_modules << EnabledModule.new(:name => name)}
+      module_names.each {|name| enable_module!(name)}
     else
       enabled_modules.clear
     end
@@ -522,6 +522,26 @@ class Project < ActiveRecord::Base
   def enabled_module_names
     enabled_modules.collect(&:name)
   end
+
+  # Enable a specific module
+  #
+  # Examples:
+  #   project.enable_module!(:issue_tracking)
+  #   project.enable_module!("issue_tracking")
+  def enable_module!(name)
+    enabled_modules << EnabledModule.new(:name => name.to_s) unless module_enabled?(name)
+  end
+
+  # Disable a module if it exists
+  #
+  # Examples:
+  #   project.disable_module!(:issue_tracking)
+  #   project.disable_module!("issue_tracking")
+  #   project.disable_module!(project.enabled_modules.first)
+  def disable_module!(target)
+    target = enabled_modules.detect{|mod| target.to_s == mod.name} if target.respond_to?(:to_sym)
+    target.destroy unless target.blank?
+  end
   
   safe_attributes 'name',
     'description',
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index 61ae3be..1ee05c6 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -553,18 +553,52 @@ class ProjectTest < ActiveSupport::TestCase
     assert_nil Project.next_identifier
   end
   
+  context "enabled_modules" do
+    setup do
+      @project = Project.find(1)
+    end
 
-  def test_enabled_module_names_should_not_recreate_enabled_modules
-    project = Project.find(1)
-    # Remove one module
-    modules = project.enabled_modules.slice(0..-2)
-    assert modules.any?
-    assert_difference 'EnabledModule.count', -1 do
-      project.enabled_module_names = modules.collect(&:name)
+    should "define module by names and preserve ids" do
+      # Remove one module
+      modules = @project.enabled_modules.slice(0..-2)
+      assert modules.any?
+      assert_difference 'EnabledModule.count', -1 do
+        @project.enabled_module_names = modules.collect(&:name)
+      end
+      @project.reload
+      # Ids should be preserved
+      assert_equal @project.enabled_module_ids.sort, modules.collect(&:id).sort
+    end
+
+    should "enable a module" do
+      @project.enabled_module_names = []
+      @project.reload
+      assert_equal [], @project.enabled_module_names
+      #with string
+      @project.enable_module!("issue_tracking")
+      assert_equal ["issue_tracking"], @project.enabled_module_names
+      #with symbol
+      @project.enable_module!(:gantt)
+      assert_equal ["issue_tracking", "gantt"], @project.enabled_module_names
+      #don't add a module twice
+      @project.enable_module!("issue_tracking")
+      assert_equal ["issue_tracking", "gantt"], @project.enabled_module_names
+    end
+
+    should "disable a module" do
+      #with string
+      assert @project.enabled_module_names.include?("issue_tracking")
+      @project.disable_module!("issue_tracking")
+      assert ! @project.reload.enabled_module_names.include?("issue_tracking")
+      #with symbol
+      assert @project.enabled_module_names.include?("gantt")
+      @project.disable_module!(:gantt)
+      assert ! @project.reload.enabled_module_names.include?("gantt")
+      #with EnabledModule object
+      first_module = @project.enabled_modules.first
+      @project.disable_module!(first_module)
+      assert ! @project.reload.enabled_module_names.include?(first_module.name)
     end
-    project.reload
-    # Ids should be preserved
-    assert_equal project.enabled_module_ids.sort, modules.collect(&:id).sort
   end
 
   def test_copy_from_existing_project
