From cbf09ee37a964374aab7f5a79077b62980eb3b35 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Fri, 7 Mar 2014 16:00:59 +0000 Subject: [PATCH] Remove paperclip gem and model definition. --- Gemfile | 1 - Gemfile.lock | 10 ---------- app/models/photo.rb | 22 ++-------------------- 3 files changed, 2 insertions(+), 31 deletions(-) diff --git a/Gemfile b/Gemfile index b0b9826..bb3a958 100644 --- a/Gemfile +++ b/Gemfile @@ -73,7 +73,6 @@ gem 'squeel' #gem 'mini_exiftool' gem 'will_paginate' gem 'redcarpet' -gem 'paperclip' gem 'dragonfly' gem 'dragonfly-s3_data_store' gem 'unf' diff --git a/Gemfile.lock b/Gemfile.lock index dc4a7ac..79f4903 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -66,11 +66,7 @@ GEM capybara-screenshot (0.3.17) capybara (>= 1.0, < 3) launchy - climate_control (0.0.3) - activesupport (>= 3.0) cliver (0.3.2) - cocaine (0.5.3) - climate_control (>= 0.0.3, < 1.0) coderay (1.1.0) coffee-rails (4.0.1) coffee-script (>= 2.2.0) @@ -142,11 +138,6 @@ GEM nokogiri (1.6.1) mini_portile (~> 0.5.0) orm_adapter (0.5.0) - paperclip (4.1.1) - activemodel (>= 3.0.0) - activesupport (>= 3.0.0) - cocaine (~> 0.5.3) - mime-types pg (0.17.1) poltergeist (1.5.0) capybara (~> 2.1) @@ -275,7 +266,6 @@ DEPENDENCIES jquery-rails letter_opener newrelic_rpm - paperclip pg poltergeist powder diff --git a/app/models/photo.rb b/app/models/photo.rb index a422998..7375b0c 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -2,28 +2,10 @@ class Photo < ActiveRecord::Base has_and_belongs_to_many :categories - has_attached_file :photo, styles: { preview: '600x600', - size17: '476x476#', - size11: '308x308#', - size8: '224x224#', - size5: '140x140#', - size3: '84x84#', - size2: '56x56#', - size17x2: '952x952#', - size11x2: '616x616#', - size8x2: '448x448#', - size5x2: '280x280#', - size3x2: '168x168#', - size2x2: '112x112#' }, - storage: :s3, - s3_credentials: "#{Rails.root}/config/s3.yml", - s3_protocol: 'https', - path: ':attachment/:id/:style.:extension', - bucket: ENV['AWS_BUCKET_NAME'], - url: ':s3_domain_url' - dragonfly_accessor :image + validates :image, presence: true + @@per_page = 11 scope :enabled, lambda {