mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Rename service and use #call
This commit is contained in:
@@ -19,7 +19,7 @@ module Api
|
||||
producer_shop: "map_003-producer-shop.svg",
|
||||
producer: "map_001-producer-only.svg",
|
||||
}
|
||||
ImagePathService.image_path(icons[enterprise.category])
|
||||
ImagePathGenerator.call(icons[enterprise.category])
|
||||
end
|
||||
|
||||
def icon_font
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ImagePathService
|
||||
class ImagePathGenerator
|
||||
# Since Rails 4 has adjusted the way assets paths are handled, we have to access certain
|
||||
# asset-based helpers like this when outside of a view or controller context.
|
||||
# See: https://stackoverflow.com/a/16609815
|
||||
def self.image_path(path)
|
||||
def self.call(path)
|
||||
ActionController::Base.helpers.image_path(path)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user