diff --git a/Gemfile b/Gemfile index b523846fa..c5ad68913 100644 --- a/Gemfile +++ b/Gemfile @@ -78,7 +78,7 @@ gem 'sneaky-save', git: 'https://github.com/einzige/sneaky-save' gem 'turbolinks', '~> 5.1.1' gem 'underscore-rails' gem 'wicked_pdf', '~> 1.1.0' -gem 'wkhtmltopdf-heroku' +gem 'wkhtmltopdf-heroku', '2.12.4' gem 'aws-sdk-rails' gem 'aws-sdk-s3' diff --git a/Gemfile.lock b/Gemfile.lock index c2297e6d7..81e522c6c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -558,7 +558,7 @@ GEM websocket-extensions (0.1.4) whacamole (1.2.0) wicked_pdf (1.1.0) - wkhtmltopdf-heroku (2.12.5.0) + wkhtmltopdf-heroku (2.12.4.0) xpath (3.2.0) nokogiri (~> 1.8) yomu (0.2.4) @@ -671,7 +671,7 @@ DEPENDENCIES webpacker (~> 3.5) whacamole wicked_pdf (~> 1.1.0) - wkhtmltopdf-heroku + wkhtmltopdf-heroku (= 2.12.4) yomu RUBY VERSION diff --git a/app/models/asset.rb b/app/models/asset.rb index 7c1faca30..5bf4a7675 100644 --- a/app/models/asset.rb +++ b/app/models/asset.rb @@ -257,7 +257,7 @@ class Asset < ApplicationRecord end def image? - content_type == %r{^image/#{Regexp.union(Constants::WHITELISTED_IMAGE_TYPES)}} + content_type =~ %r{^image/#{Regexp.union(Constants::WHITELISTED_IMAGE_TYPES)}} end def text? diff --git a/app/models/concerns/tiny_mce_images.rb b/app/models/concerns/tiny_mce_images.rb index b5cc990f2..02f5e9b53 100644 --- a/app/models/concerns/tiny_mce_images.rb +++ b/app/models/concerns/tiny_mce_images.rb @@ -18,7 +18,7 @@ module TinyMceImages description = TinyMceAsset.update_old_tinymce(description, self) tiny_mce_assets.each do |tm_asset| - tm_asset_key = tm_asset.image.preview.key + tm_asset_key = tm_asset.preview.key encoded_tm_asset = Base64.strict_encode64(tm_asset.image.service.download(tm_asset_key)) new_tm_asset_src = "data:image/jpg;base64,#{encoded_tm_asset}" html_description = Nokogiri::HTML(description)