Adds lodging model

This commit is contained in:
Gopesh Tulsyan 2014-06-14 20:41:26 +05:30
parent f0b6c32a54
commit 029281a9ae
5 changed files with 48 additions and 1 deletions

10
app/models/lodging.rb Normal file
View file

@ -0,0 +1,10 @@
class Lodging < ActiveRecord::Base
attr_accessible :name, :description, :photo
belongs_to :venue
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 }
end