Class: Imgproxy::UrlAdapters::ActiveStorage
- Inherits:
-
Object
- Object
- Imgproxy::UrlAdapters::ActiveStorage
- Defined in:
- lib/imgproxy/url_adapters/active_storage.rb
Overview
Instance Method Summary collapse
Instance Method Details
#applicable?(image) ⇒ Boolean
13 14 15 16 17 |
# File 'lib/imgproxy/url_adapters/active_storage.rb', line 13 def applicable?(image) image.is_a?(::ActiveStorage::Attached::One) || image.is_a?(::ActiveStorage::Attachment) || image.is_a?(::ActiveStorage::Blob) end |
#url(image) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/imgproxy/url_adapters/active_storage.rb', line 19 def url(image) return s3_url(image) if use_s3_url(image) return gcs_url(image) if use_gcs_url(image) Rails.application.routes.url_helpers.url_for(image) end |