Revert r6104 "Merged r6098 from trunk."
I messed things up with a cherry-pick on master, I'll re-apply it after. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.2-stable@6105 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
16ba6bcb77
commit
102c9afadf
18 files changed
+60
-131
No files matched your search
+1
-21
@@ -544,27 +544,7 @@ 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} unless enabled_modules.include?(target)
|
||||
target.destroy unless target.blank?
|
||||
end
|
||||
|
||||
|
||||
safe_attributes 'name',
|
||||
'description',
|
||||
'homepage',
|
||||
|
||||
Reference in new issue
Block a user