Use PictureUploader on Venue
This commit is contained in:
parent
f1f5fc1cd4
commit
2a4de3e869
3 changed files with 6 additions and 10 deletions
|
|
@ -8,11 +8,7 @@ class Venue < ActiveRecord::Base
|
|||
validates :name, :street, :city, :country, presence: true
|
||||
validates :conference_id, presence: true, uniqueness: true
|
||||
|
||||
has_attached_file :photo,
|
||||
styles: { thumb: '100x100>', large: '300x300>' }
|
||||
validates_attachment_content_type :photo,
|
||||
content_type: [/jpg/, /jpeg/, /png/, /gif/],
|
||||
size: { in: 0..500.kilobytes }
|
||||
mount_uploader :picture, PictureUploader, mount_on: :photo_file_name
|
||||
|
||||
before_save :send_mail_notification
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue