Created
November 12, 2009 00:14
-
-
Save edavis10/232458 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/models/project.rb b/app/models/project.rb | |
index b97d365..d4a5508 100644 | |
--- a/app/models/project.rb | |
+++ b/app/models/project.rb | |
@@ -389,7 +389,9 @@ 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.each do |name| | |
+ enabled_modules << EnabledModule.new(:name => name) unless module_enabled? name | |
+ end | |
else | |
enabled_modules.clear | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment