mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-17 13:44:09 +00:00
Use PictureUploader on Sponsor
This commit is contained in:
parent
0ad3ff01c3
commit
f1f5fc1cd4
6 changed files with 12 additions and 25 deletions
|
|
@ -1,21 +1,8 @@
|
|||
class Sponsor < ActiveRecord::Base
|
||||
belongs_to :sponsorship_level
|
||||
belongs_to :conference
|
||||
has_attached_file :logo,
|
||||
styles: { thumb: '100x100>',
|
||||
first: '320x180>',
|
||||
second: '320x150>',
|
||||
others: '320x120>' },
|
||||
# places logo on a white background to maintain size
|
||||
convert_options: {
|
||||
first: '-background white -gravity center -extent 320x180',
|
||||
second: '-background white -gravity center -extent 320x150',
|
||||
others: '-background white -gravity center -extent 320x120'
|
||||
}
|
||||
|
||||
validates_attachment_content_type :logo,
|
||||
content_type: [/jpg/, /jpeg/, /png/, /gif/],
|
||||
size: { in: 0..500.kilobytes }
|
||||
mount_uploader :picture, PictureUploader, mount_on: :logo_file_name
|
||||
|
||||
validates_presence_of :name, :website_url, :sponsorship_level, :logo
|
||||
validates_presence_of :name, :website_url, :sponsorship_level
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue