From d7d3b6ac9bade7497929e6a36b33bb97a38bf71b Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Thu, 12 Feb 2026 02:52:52 +0000 Subject: [PATCH] Simplify code (#43745). git-svn-id: https://svn.redmine.org/redmine/trunk@24407 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a96d40b7b..d6591f202 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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