osem-fcy/app/models/photo.rb
2014-06-19 21:09:15 +05:30

11 lines
430 B
Ruby

class Photo < ActiveRecord::Base
attr_accessible :picture, :description
belongs_to :conference
validates_presence_of :picture
has_attached_file :picture,
styles: { thumb: '100x100>', large: '300x300>' }
validates_attachment_content_type :picture,
content_type: [/jpg/, /jpeg/, /png/, /gif/],
size: { in: 0..500.kilobytes }
end