From 8c7a02ec102963f2bac2b320ea79df9fec1fcf9a Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 18 Oct 2012 11:13:40 +1100 Subject: [PATCH] Fix image uploads with CMS --- Gemfile | 2 +- Gemfile.lock | 7 +------ config/initializers/comfortable_mexican_sofa.rb | 5 ++++- config/s3.yml | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index 2f87854203..f8f0559a71 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,7 @@ gem 'unicorn' gem 'bugsnag' gem 'spree_heroku', :git => 'git://github.com/joneslee85/spree-heroku.git' gem 'haml' -gem 'aws-s3' +gem 'aws-sdk' gem 'andand' gem 'truncate_html' diff --git a/Gemfile.lock b/Gemfile.lock index 1fa9f631e0..941717651e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -134,10 +134,6 @@ GEM ansi (1.4.2) arel (3.0.2) awesome_print (1.0.2) - aws-s3 (0.6.3) - builder - mime-types - xml-simple aws-sdk (1.3.9) httparty (~> 0.7) json (~> 1.4) @@ -342,7 +338,6 @@ GEM uuidtools (2.1.3) warden (1.1.1) rack (>= 1.0) - xml-simple (1.1.1) xpath (0.1.4) nokogiri (~> 1.3) @@ -352,7 +347,7 @@ PLATFORMS DEPENDENCIES andand awesome_print - aws-s3 + aws-sdk bugsnag capybara coffee-rails (~> 3.2.1) diff --git a/config/initializers/comfortable_mexican_sofa.rb b/config/initializers/comfortable_mexican_sofa.rb index 900178b0cb..67872b3276 100644 --- a/config/initializers/comfortable_mexican_sofa.rb +++ b/config/initializers/comfortable_mexican_sofa.rb @@ -34,7 +34,10 @@ ComfortableMexicanSofa.configure do |config| # the upload method and appropriate settings based on Paperclip. For S3 see: # http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/S3, and for # filesystem see: http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/Filesystem - # config.upload_file_options = {:url => '/system/:class/:id/:attachment/:style/:filename'} + config.upload_file_options = { + :storage => 's3', + :s3_credentials => Rails.root.join('config', 's3.yml') + } # Sofa allows you to setup entire site from files. Database is updated with each # request (if necessary). Please note that database entries are destroyed if there's diff --git a/config/s3.yml b/config/s3.yml index 6b6b8bf42a..55742d4434 100644 --- a/config/s3.yml +++ b/config/s3.yml @@ -1,4 +1,4 @@ -developement: +development: bucket: openfoodweb_test access_key_id: AKIAJ3EE2EKGP36D4PUA secret_access_key: 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