Merged r11497 from trunk (#13329).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11574 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-03-09 10:59:22 +00:00
parent ddf0307718
commit 53680edb2d
4 changed files with 8 additions and 5 deletions

View File

@ -184,11 +184,12 @@ class Issue < ActiveRecord::Base
super super
end end
alias :base_reload :reload
def reload(*args) def reload(*args)
@workflow_rule_by_attribute = nil @workflow_rule_by_attribute = nil
@assignable_versions = nil @assignable_versions = nil
@relations = nil @relations = nil
super base_reload(*args)
end end
# Overrides Redmine::Acts::Customizable::InstanceMethods#available_custom_fields # Overrides Redmine::Acts::Customizable::InstanceMethods#available_custom_fields

View File

@ -285,6 +285,7 @@ class Project < ActiveRecord::Base
self.find(*args) self.find(*args)
end end
alias :base_reload :reload
def reload(*args) def reload(*args)
@shared_versions = nil @shared_versions = nil
@rolled_up_versions = nil @rolled_up_versions = nil
@ -297,7 +298,7 @@ class Project < ActiveRecord::Base
@actions_allowed = nil @actions_allowed = nil
@start_date = nil @start_date = nil
@due_date = nil @due_date = nil
super base_reload(*args)
end end
def to_param def to_param

View File

@ -128,11 +128,12 @@ class User < Principal
end end
end end
alias :base_reload :reload
def reload(*args) def reload(*args)
@name = nil @name = nil
@projects_by_role = nil @projects_by_role = nil
@membership_by_project_id = nil @membership_by_project_id = nil
super base_reload(*args)
end end
def mail=(arg) def mail=(arg)

View File

@ -33,7 +33,6 @@ module Redmine
:dependent => :delete_all, :dependent => :delete_all,
:validate => false :validate => false
send :alias_method, :reload_without_custom_fields, :reload
send :include, Redmine::Acts::Customizable::InstanceMethods send :include, Redmine::Acts::Customizable::InstanceMethods
validate :validate_custom_field_values validate :validate_custom_field_values
after_save :save_custom_field_values after_save :save_custom_field_values
@ -43,6 +42,7 @@ module Redmine
module InstanceMethods module InstanceMethods
def self.included(base) def self.included(base)
base.extend ClassMethods base.extend ClassMethods
base.send :alias_method_chain, :reload, :custom_fields
end end
def available_custom_fields def available_custom_fields
@ -154,7 +154,7 @@ module Redmine
@custom_field_values_changed = true @custom_field_values_changed = true
end end
def reload(*args) def reload_with_custom_fields(*args)
@custom_field_values = nil @custom_field_values = nil
@custom_field_values_changed = false @custom_field_values_changed = false
reload_without_custom_fields(*args) reload_without_custom_fields(*args)