Adds organization model

This commit is contained in:
Gopesh Tulsyan 2014-06-05 16:27:51 +05:30
parent a95a03c7e5
commit b63f3fa7c9
5 changed files with 84 additions and 10 deletions

View file

@ -0,0 +1,11 @@
class Organization < ActiveRecord::Base
attr_accessible :name, :logo, :description, :phone_number, :email, :website_url
has_attached_file :logo,
styles: { thumb: '100x100>', large: '300x300>' }
validates_attachment_content_type :logo,
content_type: [/jpg/, /jpeg/, /png/, /gif/],
size: { in: 0..500.kilobytes }
validates_presence_of :name, :website_url
validates_uniqueness_of :email
end