removed phone_number and email

This commit is contained in:
Gopesh Tulsyan 2014-06-05 16:43:55 +05:30
parent b63f3fa7c9
commit 62c78641c2
5 changed files with 5 additions and 11 deletions

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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