diff options
author | gfyoung <gfyoung17@gmail.com> | 2018-08-18 14:19:57 +0300 |
---|---|---|
committer | gfyoung <gfyoung17@gmail.com> | 2018-09-07 03:33:46 +0300 |
commit | 1993a4449a5be44acfa5a9e1a94842e05da5edd5 (patch) | |
tree | 80a38bd0b427a5baf7ca36a3a71f8eb75c9d912f /app/helpers/lazy_image_tag_helper.rb | |
parent | 07d5ee361a438fcfff28fe184bbec2aa98ce5d14 (diff) |
Enable frozen string for app/helpers/**/*.rb
Partially addresses #47424.
Diffstat (limited to 'app/helpers/lazy_image_tag_helper.rb')
-rw-r--r-- | app/helpers/lazy_image_tag_helper.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/helpers/lazy_image_tag_helper.rb b/app/helpers/lazy_image_tag_helper.rb index 603b9438e35..ac987a04895 100644 --- a/app/helpers/lazy_image_tag_helper.rb +++ b/app/helpers/lazy_image_tag_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module LazyImageTagHelper def placeholder_image "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" @@ -11,9 +13,11 @@ module LazyImageTagHelper options[:data] ||= {} options[:data][:src] = path_to_image(source) - options[:class] ||= "" - options[:class] << " lazy" + # options[:class] can be either String or Array. + klass_opts = Array.wrap(options[:class]) + klass_opts << "lazy" + options[:class] = klass_opts.join(' ') source = placeholder_image end |