|
|
|
@ -85,7 +85,20 @@ module Redmine |
|
|
|
|
def journal_class |
|
|
|
|
journal_class_name = "#{name.gsub("::", "_")}Journal" |
|
|
|
|
if Object.const_defined?(journal_class_name) |
|
|
|
|
Object.const_get(journal_class_name) |
|
|
|
|
jclass = Object.const_get(journal_class_name) |
|
|
|
|
if jclass.superclass == Journal |
|
|
|
|
jclass |
|
|
|
|
else |
|
|
|
|
# We are running into some nasty reloaded things in here. Journal |
|
|
|
|
# is a reloaded version, jclass.superclass is an older version |
|
|
|
|
# from a previous request. |
|
|
|
|
# |
|
|
|
|
# So we are just removing the const and triggering ourselves |
|
|
|
|
# recursively to create a new up-to-date version of the |
|
|
|
|
# journal_class with working superclass pointers. |
|
|
|
|
Object.send :remove_const, journal_class_name |
|
|
|
|
journal_class |
|
|
|
|
end |
|
|
|
|
else |
|
|
|
|
Object.const_set(journal_class_name, Class.new(Journal)).tap do |c| |
|
|
|
|
# Run after the inherited hook to associate with the parent record. |
|
|
|
|