Uploader changes based on https://github.com/carrierwaveuploader/carrierwave
This commit is contained in:
parent
ed22b62551
commit
9f84454a8d
2 changed files with 3 additions and 2 deletions
|
|
@ -1313,6 +1313,7 @@ Style/RegexpLiteral:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'Guardfile'
|
- 'Guardfile'
|
||||||
- 'config/initializers/airbrake.rb'
|
- 'config/initializers/airbrake.rb'
|
||||||
|
- 'app/uploaders/picture_uploader.rb'
|
||||||
|
|
||||||
# Offense count: 2
|
# Offense count: 2
|
||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
|
|
|
||||||
|
|
@ -84,12 +84,12 @@ class PictureUploader < CarrierWave::Uploader::Base
|
||||||
|
|
||||||
# Add a white list of extensions which are allowed to be uploaded.
|
# Add a white list of extensions which are allowed to be uploaded.
|
||||||
# For images you might use something like this:
|
# For images you might use something like this:
|
||||||
def extension_white_list
|
def extension_whitelist
|
||||||
%w(jpg jpeg gif png)
|
%w(jpg jpeg gif png)
|
||||||
end
|
end
|
||||||
|
|
||||||
def content_type_whitelist
|
def content_type_whitelist
|
||||||
%r{/image\//}
|
/image\//
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue