Add a picture format for conference tickets
This commit is contained in:
parent
364be55412
commit
e01d849374
4 changed files with 23 additions and 1 deletions
|
|
@ -80,6 +80,11 @@ class PictureUploader < CarrierWave::Uploader::Base
|
|||
process resize_and_pad: [320, 120, 'white']
|
||||
end
|
||||
|
||||
version :ticket, if: :conference?
|
||||
version :ticket do
|
||||
process resize_and_pad: [120, 70]
|
||||
end
|
||||
|
||||
# Add a white list of extensions which are allowed to be uploaded.
|
||||
# For images you might use something like this:
|
||||
def extension_white_list
|
||||
|
|
@ -95,4 +100,8 @@ class PictureUploader < CarrierWave::Uploader::Base
|
|||
def sponsor?(_picture)
|
||||
object_class_name == 'sponsors'
|
||||
end
|
||||
|
||||
def conference?(_picture)
|
||||
object_class_name == 'conferences'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue