added delayed_paperclip

This commit is contained in:
nilsding 2014-12-29 11:58:01 +01:00
parent 678e03deed
commit b378a03afa
6 changed files with 16 additions and 3 deletions

View File

@ -31,6 +31,7 @@ gem 'font-awesome-rails', '~> 4.2.0.0'
gem 'rails-assets-growl'
gem 'jcrop-rails-v2'
gem "paperclip", "~> 4.2"
gem 'delayed_paperclip'
gem 'ruby-progressbar'

View File

@ -84,6 +84,8 @@ GEM
crass (1.0.1)
daemons (1.1.9)
database_cleaner (1.3.0)
delayed_paperclip (2.9.0)
paperclip (>= 3.3)
devise (3.4.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
@ -349,6 +351,7 @@ DEPENDENCIES
capybara
coffee-rails (~> 4.1.0)
database_cleaner
delayed_paperclip
devise
factory_girl_rails
faker

View File

@ -40,8 +40,10 @@ class User < ActiveRecord::Base
# validates :website, format: { with: WEBSITE_REGEX }
has_attached_file :profile_picture, styles: { medium: "256x256>", thumb: "80x80>" }, default_url: "/images/:style/no_avatar.png"
has_attached_file :profile_picture, styles: { medium: "256x256>", thumb: "80x80>" },
default_url: "/images/:style/no_avatar.png", use_timestamp: false
validates_attachment_content_type :profile_picture, :content_type => /\Aimage\/.*\Z/
process_in_background :profile_picture
before_save do
self.display_name = 'WRYYYYYYYY' if display_name == 'Dio Brando'

View File

@ -7,3 +7,4 @@ production:
:concurrency: 25
:queues:
- share
- paperclip

View File

@ -0,0 +1,5 @@
class AddProfilePictureProcessingToUsers < ActiveRecord::Migration
def change
add_column :users, :profile_picture_processing, :boolean
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20141229085904) do
ActiveRecord::Schema.define(version: 20141229105013) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -163,6 +163,7 @@ ActiveRecord::Schema.define(version: 20141229085904) do
t.string "profile_picture_content_type"
t.integer "profile_picture_file_size"
t.datetime "profile_picture_updated_at"
t.boolean "profile_picture_processing"
end
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree