adds a journaled_class method

That way we do not have to load the class or do some magic parsing names when wanting to now what is journaled.
pull/25/head
Jens Ulferts 12 years ago
parent 747196f9b1
commit db265d3123
  1. 3
      vendor/plugins/acts_as_journalized/lib/acts_as_journalized.rb

@ -115,6 +115,9 @@ module Redmine
c.class_eval("belongs_to :journaled, :class_name => '#{name}' #{include_option}")
c.class_eval("belongs_to :#{name.gsub("::", "_").underscore},
:foreign_key => 'journaled_id' #{include_option}")
c.class_eval("def self.journaled_class
#{self}
end")
end
end
end

Loading…
Cancel
Save