@@ -5,5 +5,4 @@ class BlogPost < ActiveRecord::Base |
||
| 5 | 5 |
belongs_to :author, :class_name => "User" |
| 6 | 6 |
mount_uploader :image, CoverUploader |
| 7 | 7 |
process_in_background :image |
| 8 |
- store_in_background :image |
|
| 9 | 8 |
end |
@@ -2,7 +2,6 @@ class Upload < ActiveRecord::Base |
||
| 2 | 2 |
|
| 3 | 3 |
mount_uploader :file, FileUploader |
| 4 | 4 |
process_in_background :file |
| 5 |
- store_in_background :file |
|
| 6 | 5 |
|
| 7 | 6 |
|
| 8 | 7 |
def get_extension |
@@ -11,7 +11,6 @@ class User < ActiveRecord::Base |
||
| 11 | 11 |
|
| 12 | 12 |
mount_uploader :avatar, AvatarUploader |
| 13 | 13 |
process_in_background :avatar |
| 14 |
- store_in_background :avatar |
|
| 15 | 14 |
|
| 16 | 15 |
def full_name |
| 17 | 16 |
name = self.first_name.to_s + ' ' + self.last_name.to_s |
@@ -37,7 +37,10 @@ class AvatarUploader < CarrierWave::Uploader::Base |
||
| 37 | 37 |
def root |
| 38 | 38 |
"#{Rails.root}/public"
|
| 39 | 39 |
end |
| 40 |
- |
|
| 40 |
+ |
|
| 41 |
+ def cache_dir |
|
| 42 |
+ "#{Rails.root}/tmp/uploads/#{mounted_as}/"
|
|
| 43 |
+ end |
|
| 41 | 44 |
|
| 42 | 45 |
# Provide a default URL as a default if there hasn't been a file uploaded: |
| 43 | 46 |
# def default_url |
@@ -37,7 +37,10 @@ class CoverUploader < CarrierWave::Uploader::Base |
||
| 37 | 37 |
def root |
| 38 | 38 |
"#{Rails.root}/public"
|
| 39 | 39 |
end |
| 40 |
- |
|
| 40 |
+ |
|
| 41 |
+ def cache_dir |
|
| 42 |
+ "#{Rails.root}/tmp/uploads/#{mounted_as}/"
|
|
| 43 |
+ end |
|
| 41 | 44 |
|
| 42 | 45 |
# Provide a default URL as a default if there hasn't been a file uploaded: |
| 43 | 46 |
# def default_url |
@@ -34,7 +34,10 @@ class FileUploader < CarrierWave::Uploader::Base |
||
| 34 | 34 |
def root |
| 35 | 35 |
"#{Rails.root}/public"
|
| 36 | 36 |
end |
| 37 |
- |
|
| 37 |
+ |
|
| 38 |
+ def cache_dir |
|
| 39 |
+ "#{Rails.root}/tmp/uploads/#{mounted_as}/"
|
|
| 40 |
+ end |
|
| 38 | 41 |
|
| 39 | 42 |
# Provide a default URL as a default if there hasn't been a file uploaded: |
| 40 | 43 |
# def default_url |