From cff537f8f8ce6b0a5befb9f16ae82e10895ab4be Mon Sep 17 00:00:00 2001 From: Andy Leverenz Date: Wed, 21 Aug 2024 14:51:30 -0500 Subject: [PATCH] Fix pathname conversion error on custom_paths --- Gemfile.lock | 2 +- lib/railsui_icon/configuration.rb | 3 +-- lib/railsui_icon/helpers.rb | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0ab6055..e3046cb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - railsui_icon (0.1.0) + railsui_icon (1.0.6) rails (>= 5.2) GEM diff --git a/lib/railsui_icon/configuration.rb b/lib/railsui_icon/configuration.rb index a3d95e0..6b118ee 100644 --- a/lib/railsui_icon/configuration.rb +++ b/lib/railsui_icon/configuration.rb @@ -2,12 +2,11 @@ module RailsuiIcon class Configuration - attr_accessor :default_class, :default_variant, :custom_icon_paths + attr_accessor :default_class, :default_variant def initialize @default_class = "" @default_variant = :outline - @custom_icon_paths = [] end end end diff --git a/lib/railsui_icon/helpers.rb b/lib/railsui_icon/helpers.rb index 9e7cfcc..8805ea2 100644 --- a/lib/railsui_icon/helpers.rb +++ b/lib/railsui_icon/helpers.rb @@ -19,10 +19,10 @@ def icon(name, options = {}) def resolve_custom_path(path) return unless path - if Rails.application.config.assets.paths.any? { |p| path.start_with?(p) } - path + if Rails.application.config.assets.paths.any? { |p| path.to_s.start_with?(p.to_s) } + path.to_s else - ActionController::Base.helpers.asset_path(path) + ActionController::Base.helpers.asset_path(path.to_s) end end end