Skip to content

Commit

Permalink
Fix pathname conversion error on custom_paths
Browse files Browse the repository at this point in the history
  • Loading branch information
justalever committed Aug 21, 2024
1 parent a923218 commit cff537f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
railsui_icon (0.1.0)
railsui_icon (1.0.6)
rails (>= 5.2)

GEM
Expand Down
3 changes: 1 addition & 2 deletions lib/railsui_icon/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions lib/railsui_icon/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cff537f

Please sign in to comment.