added delayed_paperclip
This commit is contained in:
parent
678e03deed
commit
b378a03afa
1
Gemfile
1
Gemfile
|
@ -31,6 +31,7 @@ gem 'font-awesome-rails', '~> 4.2.0.0'
|
||||||
gem 'rails-assets-growl'
|
gem 'rails-assets-growl'
|
||||||
gem 'jcrop-rails-v2'
|
gem 'jcrop-rails-v2'
|
||||||
gem "paperclip", "~> 4.2"
|
gem "paperclip", "~> 4.2"
|
||||||
|
gem 'delayed_paperclip'
|
||||||
|
|
||||||
gem 'ruby-progressbar'
|
gem 'ruby-progressbar'
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,8 @@ GEM
|
||||||
crass (1.0.1)
|
crass (1.0.1)
|
||||||
daemons (1.1.9)
|
daemons (1.1.9)
|
||||||
database_cleaner (1.3.0)
|
database_cleaner (1.3.0)
|
||||||
|
delayed_paperclip (2.9.0)
|
||||||
|
paperclip (>= 3.3)
|
||||||
devise (3.4.1)
|
devise (3.4.1)
|
||||||
bcrypt (~> 3.0)
|
bcrypt (~> 3.0)
|
||||||
orm_adapter (~> 0.1)
|
orm_adapter (~> 0.1)
|
||||||
|
@ -349,6 +351,7 @@ DEPENDENCIES
|
||||||
capybara
|
capybara
|
||||||
coffee-rails (~> 4.1.0)
|
coffee-rails (~> 4.1.0)
|
||||||
database_cleaner
|
database_cleaner
|
||||||
|
delayed_paperclip
|
||||||
devise
|
devise
|
||||||
factory_girl_rails
|
factory_girl_rails
|
||||||
faker
|
faker
|
||||||
|
|
|
@ -40,8 +40,10 @@ class User < ActiveRecord::Base
|
||||||
|
|
||||||
# validates :website, format: { with: WEBSITE_REGEX }
|
# 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/
|
validates_attachment_content_type :profile_picture, :content_type => /\Aimage\/.*\Z/
|
||||||
|
process_in_background :profile_picture
|
||||||
|
|
||||||
before_save do
|
before_save do
|
||||||
self.display_name = 'WRYYYYYYYY' if display_name == 'Dio Brando'
|
self.display_name = 'WRYYYYYYYY' if display_name == 'Dio Brando'
|
||||||
|
|
|
@ -6,4 +6,5 @@ staging:
|
||||||
production:
|
production:
|
||||||
:concurrency: 25
|
:concurrency: 25
|
||||||
:queues:
|
:queues:
|
||||||
- share
|
- share
|
||||||
|
- paperclip
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddProfilePictureProcessingToUsers < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :users, :profile_picture_processing, :boolean
|
||||||
|
end
|
||||||
|
end
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# 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
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -163,6 +163,7 @@ ActiveRecord::Schema.define(version: 20141229085904) do
|
||||||
t.string "profile_picture_content_type"
|
t.string "profile_picture_content_type"
|
||||||
t.integer "profile_picture_file_size"
|
t.integer "profile_picture_file_size"
|
||||||
t.datetime "profile_picture_updated_at"
|
t.datetime "profile_picture_updated_at"
|
||||||
|
t.boolean "profile_picture_processing"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
|
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
|
||||||
|
|
Loading…
Reference in New Issue