From 1af81684260f68c958a04df8adcd4d13b11f143f Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Sun, 10 Nov 2024 15:29:42 +0000 Subject: [PATCH] Use double splat operator for icons methods that are extending @sprite_icon@ (#23980). git-svn-id: https://svn.redmine.org/redmine/trunk@23229 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/icons_helper.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb index 5654f3a2f..f423a2898 100644 --- a/app/helpers/icons_helper.rb +++ b/app/helpers/icons_helper.rb @@ -36,20 +36,20 @@ module IconsHelper end end - def file_icon(entry, name, size: DEFAULT_ICON_SIZE, css_class: nil) + def file_icon(entry, name, **options) if entry.is_dir? - sprite_icon("folder", name, size: size, css_class: css_class) + sprite_icon("folder", name, **options) else icon_name = icon_for_mime_type(Redmine::MimeType.css_class_of(name)) - sprite_icon(icon_name, name, size: size, css_class: css_class) + sprite_icon(icon_name, name, **options) end end - def principal_icon(principal_class, size: DEFAULT_ICON_SIZE, css_class: nil) - sprite_icon('group', size: size, css_class: css_class) if ['groupanonymous', 'groupnonmember', 'group'].include?(principal_class) + def principal_icon(principal_class, **options) + sprite_icon('group', **options) if ['groupanonymous', 'groupnonmember', 'group'].include?(principal_class) end - def activity_event_type_icon(event_type, size: DEFAULT_ICON_SIZE, css_class: nil) + def activity_event_type_icon(event_type, **options) icon_name = case event_type when 'reply' 'comments' @@ -61,7 +61,7 @@ module IconsHelper event_type end - sprite_icon(icon_name, size: size, css_class: css_class) + sprite_icon(icon_name, **options) end private -- 2.39.5