From e2ffc2b4f847c15ea73fa161b673885e704e4cf2 Mon Sep 17 00:00:00 2001 From: Sherwin H Date: Fri, 25 Oct 2019 12:47:40 -0700 Subject: [PATCH] chore(deprecate): emit warning when generating srcsets --- lib/imgix/rails/tag.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/imgix/rails/tag.rb b/lib/imgix/rails/tag.rb index c77b26c..d0a0d53 100644 --- a/lib/imgix/rails/tag.rb +++ b/lib/imgix/rails/tag.rb @@ -15,6 +15,9 @@ def initialize(path, source: nil, tag_options: {}, url_params: {}, widths: []) protected def srcset(url_params: @url_params, widths: @widths) + if url_params[:w].present? + warn "Warning: srcset generation will be refactored in the next major release to provide greater flexibility and capabilities in serving responsive images. Unfortunately, these changes will require adjustments to logic that can cause unexpected behavior for users who are using this gem in its current state. Please consult this project's documentation when upgrading to better understand the expected behavior." + end widths = widths || target_widths srcset_url_params = url_params.clone