]> source.dussan.org Git - redmine.git/commitdiff
Class mismatch when reloading in development mode (#17431).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 14 Jul 2014 10:37:10 +0000 (10:37 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 14 Jul 2014 10:37:10 +0000 (10:37 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@13323 e93f8b46-1217-0410-a6f0-8f06a7374b81

config/initializers/30-redmine.rb
lib/redmine/field_format.rb

index b0cc1f752677e70dade4f5fa56b88857b28b4b61..f0fc4d4c688a0c999ed6dca024ff072b1d772437 100644 (file)
@@ -20,3 +20,9 @@ Redmine::Plugin.load
 unless Redmine::Configuration['mirror_plugins_assets_on_startup'] == false
   Redmine::Plugin.mirror_assets
 end
+
+Rails.application.config.to_prepare do
+  Redmine::FieldFormat::RecordList.subclasses.each do |klass|
+    klass.instance.reset_target_class
+  end
+end
\ No newline at end of file
index b71a79f9b3871249e51cd9963a3cd44fdc6bf226..18e5d74a816d7b04018f8551cf8e6469016cac87 100644 (file)
@@ -597,6 +597,10 @@ module Redmine
       def target_class
         @target_class ||= self.class.name[/^(.*::)?(.+)Format$/, 2].constantize rescue nil
       end
+
+      def reset_target_class
+        @target_class = nil
+      end
  
       def possible_custom_value_options(custom_value)
         options = possible_values_options(custom_value.custom_field, custom_value.customized)