removed phone_number and email
This commit is contained in:
parent
b63f3fa7c9
commit
62c78641c2
5 changed files with 5 additions and 11 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
class Organization < ActiveRecord::Base
|
class Organization < ActiveRecord::Base
|
||||||
attr_accessible :name, :logo, :description, :phone_number, :email, :website_url
|
attr_accessible :name, :logo, :description, :website_url
|
||||||
has_attached_file :logo,
|
has_attached_file :logo,
|
||||||
styles: { thumb: '100x100>', large: '300x300>' }
|
styles: { thumb: '100x100>', large: '300x300>' }
|
||||||
|
|
||||||
|
|
@ -7,5 +7,5 @@ class Organization < ActiveRecord::Base
|
||||||
content_type: [/jpg/, /jpeg/, /png/, /gif/],
|
content_type: [/jpg/, /jpeg/, /png/, /gif/],
|
||||||
size: { in: 0..500.kilobytes }
|
size: { in: 0..500.kilobytes }
|
||||||
validates_presence_of :name, :website_url
|
validates_presence_of :name, :website_url
|
||||||
validates_uniqueness_of :email
|
validates_uniqueness_of :website_url
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ class CreateOrganizations < ActiveRecord::Migration
|
||||||
def change
|
def change
|
||||||
create_table :organizations do |t|
|
create_table :organizations do |t|
|
||||||
t.string :name
|
t.string :name
|
||||||
t.string :email
|
|
||||||
t.string :phone_number
|
|
||||||
t.string :website_url
|
t.string :website_url
|
||||||
t.text :description
|
t.text :description
|
||||||
t.string :logo_file_name
|
t.string :logo_file_name
|
||||||
|
|
|
||||||
|
|
@ -188,8 +188,6 @@ ActiveRecord::Schema.define(version: 20140605101748) do
|
||||||
|
|
||||||
create_table "organizations", force: true do |t|
|
create_table "organizations", force: true do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.string "email"
|
|
||||||
t.string "phone_number"
|
|
||||||
t.string "website_url"
|
t.string "website_url"
|
||||||
t.text "description"
|
t.text "description"
|
||||||
t.string "logo_file_name"
|
t.string "logo_file_name"
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,7 @@
|
||||||
FactoryGirl.define do
|
FactoryGirl.define do
|
||||||
factory :organization do
|
factory :organization do
|
||||||
name 'Example organization'
|
name 'Example organization'
|
||||||
sequence(:email) { |n| "example#{n}@example.com" }
|
sequence(:website_url) { |n| "example#{n}@example.com" }
|
||||||
website_url 'www.esxample.com'
|
|
||||||
description 'Lorem Ipsum Dolor'
|
description 'Lorem Ipsum Dolor'
|
||||||
phone_number '900099009'
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ describe Organization do
|
||||||
should validate_presence_of(:website_url)
|
should validate_presence_of(:website_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'is not valid with a duplicate email' do
|
it 'is not valid with a duplicate website_url' do
|
||||||
should validate_uniqueness_of(:email)
|
should validate_uniqueness_of(:website_url)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue