Adds photo to venue

This commit is contained in:
Gopesh Tulsyan 2014-06-14 18:33:39 +05:30
parent b94ee7e758
commit f5c5e6a44b
6 changed files with 24 additions and 2 deletions

View file

@ -1,8 +1,13 @@
class Venue < ActiveRecord::Base
attr_accessible :name, :description, :address, :website
attr_accessible :name, :description, :website, :address, :photo
has_many :conferences
before_create :generate_guid
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 }
private
def generate_guid