diff --git a/Gemfile b/Gemfile index ccd185b..3895206 100644 --- a/Gemfile +++ b/Gemfile @@ -65,7 +65,7 @@ gem 'will_paginate', '3.0.7' gem 'bootstrap-will_paginate', '0.0.10' # Paperclip for easy file attachment -gem 'paperclip', '4.3.4' +gem 'paperclip', '>= 5.2.0' # Use devise for users and admins gem 'devise', '3.5.6' diff --git a/Gemfile.lock b/Gemfile.lock index 0a36531..bd71bf1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -78,8 +78,6 @@ GEM sshkit (~> 1.2) chunky_png (1.3.11) climate_control (0.2.0) - cocaine (0.5.8) - climate_control (>= 0.0.3, < 1.0) codeclimate-test-reporter (1.0.9) simplecov (<= 0.13) coffee-rails (4.2.2) @@ -167,7 +165,7 @@ GEM mime-types (3.2.2) mime-types-data (~> 3.2015) mime-types-data (3.2019.0331) - mimemagic (0.3.0) + mimemagic (0.3.3) mini_mime (1.0.1) mini_portile2 (2.4.0) minitest (5.11.3) @@ -193,12 +191,12 @@ GEM oauth2 (~> 1.0) omniauth (~> 1.2) orm_adapter (0.5.0) - paperclip (4.3.4) - activemodel (>= 3.2.0) - activesupport (>= 3.2.0) - cocaine (~> 0.5.5) + paperclip (6.1.0) + activemodel (>= 4.2.0) + activesupport (>= 4.2.0) mime-types - mimemagic (= 0.3.0) + mimemagic (~> 0.3.0) + terrapin (~> 0.6.0) public_suffix (3.0.3) rack (1.6.11) rack-test (0.6.3) @@ -286,6 +284,8 @@ GEM net-ssh (>= 2.8.0) term-ansicolor (1.7.1) tins (~> 1.0) + terrapin (0.6.0) + climate_control (>= 0.0.3, < 1.0) thor (0.19.4) thread_safe (0.3.6) tilt (1.4.1) @@ -335,7 +335,7 @@ DEPENDENCIES jquery-rails (= 4.1.0) mysql2 (~> 0.4.10) omniauth-oauth2 (= 1.3.1) - paperclip (= 4.3.4) + paperclip (>= 5.2.0) rails (= 4.2.10) rspec-rails sass-rails (~> 4.0.3) diff --git a/app/models/user.rb b/app/models/user.rb index 7967d3d..7f9395b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -36,7 +36,7 @@ class User < ActiveRecord::Base def self.from_omniauth(auth) where(name: auth.uid).first_or_create do |user| user.name = auth.uid - user.avatar = Identicon.data_url_for auth.uid + user.avatar = Paperclip.io_adapters.for(Identicon.data_url_for auth.uid) user.generate_key! end end diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb new file mode 100644 index 0000000..14431ce --- /dev/null +++ b/config/initializers/paperclip.rb @@ -0,0 +1 @@ +Paperclip::DataUriAdapter.register