Simplify code (#43745).

git-svn-id: https://svn.redmine.org/redmine/trunk@24407 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2026-02-12 02:52:52 +00:00
parent 8bf7f09112
commit d7d3b6ac9b

View File

@@ -899,7 +899,7 @@ module ApplicationHelper
# * with a String: textilizable(text, options)
# * with an object and one of its attribute: textilizable(issue, :description, options)
def textilizable(*args)
options = args.last.is_a?(Hash) ? args.pop : {}
options = args.extract_options!
case args.size
when 1
obj = options[:object]
@@ -913,7 +913,7 @@ module ApplicationHelper
end
return '' if text.blank?
project = options[:project] || @project || (obj && obj.respond_to?(:project) ? obj.project : nil)
project = options[:project] || @project || obj.try(:project)
@only_path = only_path = options[:only_path] = (options[:only_path] != false)
text = text.dup