diff --git a/app/models/organization.rb b/app/models/organization.rb index 3434f59f..cb44d66f 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -1,5 +1,5 @@ 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, styles: { thumb: '100x100>', large: '300x300>' } @@ -7,5 +7,5 @@ class Organization < ActiveRecord::Base content_type: [/jpg/, /jpeg/, /png/, /gif/], size: { in: 0..500.kilobytes } validates_presence_of :name, :website_url - validates_uniqueness_of :email + validates_uniqueness_of :website_url end diff --git a/db/migrate/20140605101748_create_organizations.rb b/db/migrate/20140605101748_create_organizations.rb index bfc37329..1a1c43c2 100644 --- a/db/migrate/20140605101748_create_organizations.rb +++ b/db/migrate/20140605101748_create_organizations.rb @@ -2,8 +2,6 @@ class CreateOrganizations < ActiveRecord::Migration def change create_table :organizations do |t| t.string :name - t.string :email - t.string :phone_number t.string :website_url t.text :description t.string :logo_file_name diff --git a/db/schema.rb b/db/schema.rb index bbef9dc1..c985fb9d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -188,8 +188,6 @@ ActiveRecord::Schema.define(version: 20140605101748) do create_table "organizations", force: true do |t| t.string "name" - t.string "email" - t.string "phone_number" t.string "website_url" t.text "description" t.string "logo_file_name" diff --git a/spec/factories/organizations.rb b/spec/factories/organizations.rb index 4c8a5ad4..98d9a628 100644 --- a/spec/factories/organizations.rb +++ b/spec/factories/organizations.rb @@ -3,9 +3,7 @@ FactoryGirl.define do factory :organization do name 'Example organization' - sequence(:email) { |n| "example#{n}@example.com" } - website_url 'www.esxample.com' + sequence(:website_url) { |n| "example#{n}@example.com" } description 'Lorem Ipsum Dolor' - phone_number '900099009' end end diff --git a/spec/models/organization_spec.rb b/spec/models/organization_spec.rb index 1a6dbc78..414a225b 100644 --- a/spec/models/organization_spec.rb +++ b/spec/models/organization_spec.rb @@ -15,8 +15,8 @@ describe Organization do should validate_presence_of(:website_url) end - it 'is not valid with a duplicate email' do - should validate_uniqueness_of(:email) + it 'is not valid with a duplicate website_url' do + should validate_uniqueness_of(:website_url) end end end