]> source.dussan.org Git - redmine.git/commitdiff
Merged r11497 from trunk (#13329).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 9 Mar 2013 10:59:22 +0000 (10:59 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 9 Mar 2013 10:59:22 +0000 (10:59 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11574 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb
app/models/project.rb
app/models/user.rb
lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb

index 36beed6c4541e775510872e418bd56b08b0c315d..cc50637e008d64b0274de6e5a5a9aaf5477cf144 100644 (file)
@@ -184,11 +184,12 @@ class Issue < ActiveRecord::Base
     super
   end
 
+  alias :base_reload :reload
   def reload(*args)
     @workflow_rule_by_attribute = nil
     @assignable_versions = nil
     @relations = nil
-    super
+    base_reload(*args)
   end
 
   # Overrides Redmine::Acts::Customizable::InstanceMethods#available_custom_fields
index 4591d563c85f02cf4bab8037c2a7145b3a27ca6b..49fa9dcde8ca6c7f562500010c590bc4545a3f47 100644 (file)
@@ -285,6 +285,7 @@ class Project < ActiveRecord::Base
     self.find(*args)
   end
 
+  alias :base_reload :reload
   def reload(*args)
     @shared_versions = nil
     @rolled_up_versions = nil
@@ -297,7 +298,7 @@ class Project < ActiveRecord::Base
     @actions_allowed = nil
     @start_date = nil
     @due_date = nil
-    super
+    base_reload(*args)
   end
 
   def to_param
index 81c74e52acd293ad713fe92fd9fa6690d929c6d8..2bfbbd14e8d159cdcb211a6a6262ed9eb5205c38 100644 (file)
@@ -128,11 +128,12 @@ class User < Principal
     end
   end
 
+  alias :base_reload :reload
   def reload(*args)
     @name = nil
     @projects_by_role = nil
     @membership_by_project_id = nil
-    super
+    base_reload(*args)
   end
 
   def mail=(arg)
index 28cefd4ef4570a7baf44465596628c67a2b7f55d..1f1aa1e445f6b3fb8702a77ef947c2e804fffe73 100644 (file)
@@ -33,7 +33,6 @@ module Redmine
                                    :dependent => :delete_all,
                                    :validate => false
 
-          send :alias_method, :reload_without_custom_fields, :reload
           send :include, Redmine::Acts::Customizable::InstanceMethods
           validate :validate_custom_field_values
           after_save :save_custom_field_values
@@ -43,6 +42,7 @@ module Redmine
       module InstanceMethods
         def self.included(base)
           base.extend ClassMethods
+          base.send :alias_method_chain, :reload, :custom_fields
         end
 
         def available_custom_fields
@@ -154,7 +154,7 @@ module Redmine
           @custom_field_values_changed = true
         end
 
-        def reload(*args)
+        def reload_with_custom_fields(*args)
           @custom_field_values = nil
           @custom_field_values_changed = false
           reload_without_custom_fields(*args)