Cleanup instance variables when reloading a project.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8979 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-02-24 18:38:05 +00:00
parent 67d816705d
commit 492cce7975
1 changed files with 13 additions and 0 deletions

View File

@ -272,6 +272,19 @@ class Project < ActiveRecord::Base
end
end
def reload(*args)
@shared_versions = nil
@rolled_up_versions = nil
@rolled_up_trackers = nil
@all_issue_custom_fields = nil
@all_time_entry_custom_fields = nil
@to_param = nil
@allowed_parents = nil
@allowed_permissions = nil
@actions_allowed = nil
super
end
def to_param
# id is used for projects with a numeric identifier (compatibility)
@to_param ||= (identifier.to_s =~ %r{^\d*$} ? id.to_s : identifier)