Signed-off-by: Alex Coles <alex@alexbcoles.com>
@ -27,8 +27,6 @@
#++
class OpenProject::JournalFormatter::Attachment < ::JournalFormatter::Base
# unloadable
include ApplicationHelper
include OpenProject::StaticRouting::UrlHelpers
class OpenProject::JournalFormatter::CustomField < ::JournalFormatter::Base
include CustomFieldsHelper
private
@ -29,8 +29,6 @@
require_dependency 'journal_formatter/base'
class OpenProject::JournalFormatter::Diff < JournalFormatter::Base
def render(key, values, options = {})
merge_options = { only_path: true,
no_html: false }.merge(options)
@ -30,8 +30,6 @@ module OpenProject
module WikiFormatting
module Macros
class TimelinesWikiMacro
unloadable
def apply(_content, args, options = {})
timeline = Timeline.find_by(id: args[0])
@ -228,8 +228,6 @@ module Pagination::Controller
def self.extended(base)
base.instance_eval do
def paginate_models(*args)
args.each do |arg|
paginate_model(arg)
module Acts
module Journalized
class JournalObjectCache
def fetch(klass, id, &_block)
@cache ||= Hash.new do |klass_hash, klass_key|
klass_hash[klass_key] = Hash.new do |id_hash, id_key|
@ -50,7 +50,6 @@
# It provides the hooks to apply different formatting to the details
# of a specific journal.
module JournalDeprecated
# Old timestamps. created_at is what t.timestamps creates in recent Rails journals
def created_on
created_at
@ -51,7 +51,6 @@
module JournalFormatter
mattr_accessor :formatters, :registered_fields
def self.register(hash)
class JournalFormatter::Attribute < JournalFormatter::Base
def format_details(key, values)
class JournalFormatter::Base
include Redmine::I18n
include ActionView::Helpers::TagHelper
include ActionView::Helpers::UrlHelper
class JournalFormatter::Datetime < JournalFormatter::Attribute
def format_values(values)
values.map do |v|
v.nil? ?
class JournalFormatter::Decimal < JournalFormatter::Attribute
values.map { |v| v.to_i.to_s }
end
class JournalFormatter::Fraction < JournalFormatter::Attribute
class JournalFormatter::Id < JournalFormatter::Attribute
values.map { |v| "##{v}" }
class JournalFormatter::NamedAssociation < JournalFormatter::Attribute
def render(key, values, options = { no_html: false })
label, old_value, value = format_details(key, values, options)
class JournalFormatter::Plaintext < JournalFormatter::Attribute
values.map { |v| v.try(:to_s) }
class JournalFormatter::Proc < JournalFormatter::Attribute
class << self
attr_accessor :proc