Adds organization model
This commit is contained in:
parent
a95a03c7e5
commit
b63f3fa7c9
5 changed files with 84 additions and 10 deletions
11
app/models/organization.rb
Normal file
11
app/models/organization.rb
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue