From 5a54cb52f8b46283ddb6059e53f0d49886983ccf Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 16 Jul 2019 18:55:15 +0100 Subject: [PATCH] Drop paperclip --- Gemfile | 1 - Gemfile.lock | 13 ------------- config/initializers/paperclip.rb | 25 ------------------------- 3 files changed, 39 deletions(-) delete mode 100644 config/initializers/paperclip.rb diff --git a/Gemfile b/Gemfile index 0a00a6496e..c2bb066b7c 100644 --- a/Gemfile +++ b/Gemfile @@ -56,7 +56,6 @@ gem "http_accept_language", "~> 2.0.0" gem "i18n-js", ">= 3.0.0" gem "oauth-plugin", ">= 0.5.1" gem "openstreetmap-deadlock_retry", ">= 1.3.0", :require => "deadlock_retry" -gem "paperclip", "~> 5.2" gem "rack-cors" gem "rails-i18n", "~> 4.0.0" gem "record_tag_helper" diff --git a/Gemfile.lock b/Gemfile.lock index 467166f0f4..c82719f28a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -107,7 +107,6 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (>= 2.0, < 4.0) - climate_control (0.2.0) cliver (0.3.2) coderay (1.1.2) coffee-rails (4.2.2) @@ -254,9 +253,6 @@ GEM marcel (0.3.3) mimemagic (~> 0.3.2) method_source (0.9.2) - mime-types (3.2.2) - mime-types-data (~> 3.2015) - mime-types-data (3.2019.0331) mimemagic (0.3.3) mini_magick (4.9.3) mini_mime (1.0.1) @@ -311,12 +307,6 @@ GEM multi_json (~> 1.12) omniauth-oauth2 (~> 1.4) openstreetmap-deadlock_retry (1.3.0) - paperclip (5.3.0) - activemodel (>= 4.2.0) - activesupport (>= 4.2.0) - mime-types - mimemagic (~> 0.3.0) - terrapin (~> 0.6.0) parallel (1.17.0) parser (2.6.3.0) ast (~> 2.4.0) @@ -429,8 +419,6 @@ GEM activerecord (>= 5) term-ansicolor (1.7.1) tins (~> 1.0) - terrapin (0.6.0) - climate_control (>= 0.0.3, < 1.0) thor (0.20.3) thread_safe (0.3.6) tilt (2.0.9) @@ -512,7 +500,6 @@ DEPENDENCIES omniauth-openid omniauth-windowslive openstreetmap-deadlock_retry (>= 1.3.0) - paperclip (~> 5.2) pg poltergeist psych diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb deleted file mode 100644 index 3aa1d003e3..0000000000 --- a/config/initializers/paperclip.rb +++ /dev/null @@ -1,25 +0,0 @@ -module Paperclip - class AssetUrlGenerator < UrlGenerator - include Sprockets::Rails::Helper - - def for(style_name, options) - url = super(style_name, options) - - if url =~ %r{^/assets/(.*)$} - asset_path(Regexp.last_match(1)) - else - url - end - end - end -end - -Rails.application.config.after_initialize do |_app| - Paperclip::AssetUrlGenerator::VIEW_ACCESSORS.each do |attr| - Paperclip::AssetUrlGenerator.send("#{attr}=", ActionView::Base.send(attr)) - end -end - -Paperclip::Attachment.default_options[:url] = "/attachments/:class/:attachment/:id_partition/:style/:fingerprint.:extension" -Paperclip::Attachment.default_options[:path] = "#{Settings.attachments_dir}/:class/:attachment/:id_partition/:style/:fingerprint.:extension" -Paperclip::Attachment.default_options[:url_generator] = Paperclip::AssetUrlGenerator