From ee21621dfb1f6679017ffdfb6be0cc1ca90f6638 Mon Sep 17 00:00:00 2001 From: "Ira W. Snyder" Date: Thu, 22 Nov 2007 16:30:22 -0800 Subject: [PATCH] Revert "Add the has_many_polymorphs purchaseable model" This reverts commit 97d39268c0b348898dca1ec24552eb26a94ae546. --- app/models/customer.rb | 2 -- app/models/purchase.rb | 4 ---- db/development.sqlite3 | Bin 13312 -> 11264 bytes db/migrate/016_create_purchases.rb | 13 ------------- db/schema.rb | 8 +------- test/fixtures/purchases.yml | 5 ----- test/unit/purchase_test.rb | 10 ---------- 7 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 app/models/purchase.rb delete mode 100644 db/migrate/016_create_purchases.rb delete mode 100644 test/fixtures/purchases.yml delete mode 100644 test/unit/purchase_test.rb diff --git a/app/models/customer.rb b/app/models/customer.rb index 58db47d..901b9a5 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -2,8 +2,6 @@ class Customer < ActiveRecord::Base has_many :coitems has_many :bitems - has_many_polymorphs :purchaseables, :from => [:coitems, :bitems], :through => :purchases - validates_presence_of :name, :email, :phone, :address validates_numericality_of :debt diff --git a/app/models/purchase.rb b/app/models/purchase.rb deleted file mode 100644 index 023f423..0000000 --- a/app/models/purchase.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Purchase < ActiveRecord::Base - belongs_to :customer - belongs_to :purchaseable, :polymorphic => true -end diff --git a/db/development.sqlite3 b/db/development.sqlite3 index 2867aee7a35507103da3379078bf586c2dc82d83..10e50e7d4e68027ab0e2dc78f2efe5e5df8782e3 100644 GIT binary patch delta 142 zcmZq3Xo#2~EqI#&6_`xavEgE5{tXi4Wd6Nbkfn#2iH&s=%YSA@{!JV#JY39-M;RE8 zG6^&N+t|3BakHDKHPa>u77jjE1|0?_A*P9pix_S&=uC8!np|tNcCxwh$;ro*3MMy- h*KZD2%xC1`1scr6e3pUv74uo3=?9rNpH(+z0RYM+BcuQT delta 307 zcmZpOXvml#EqIRs6_`%cvEgB2{st1|W&X|lZL=UtD>FMMCy>v^wu$9GGo!#J4i+9B z7DhJ)MmNSOO!dr-8yn3SHy;(XW|}OdRKH1rg@cQkF`R)hoaq>|*~Ugs#?2Fz@);*D zQY@H!L*W!3FVHAv<{b>oub9s=?*N*=idj^cnUz76kQSIiRw1b9GPCZ<{jrdnprjg5s&lXVodI#1VEbOGgBrfDogUBh)sU4B+sY` E00whYApigX diff --git a/db/migrate/016_create_purchases.rb b/db/migrate/016_create_purchases.rb deleted file mode 100644 index 08bb7aa..0000000 --- a/db/migrate/016_create_purchases.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreatePurchases < ActiveRecord::Migration - def self.up - create_table :purchases do |t| - t.column :customer_id, :integer - t.column :purchaseable_id, :integer - t.column :purchaseable_type, :string - end - end - - def self.down - drop_table :purchases - end -end diff --git a/db/schema.rb b/db/schema.rb index b349a76..dcfe7d9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2,7 +2,7 @@ # migrations feature of ActiveRecord to incrementally modify your database, and # then regenerate this schema definition. -ActiveRecord::Schema.define(:version => 16) do +ActiveRecord::Schema.define(:version => 15) do create_table "bitems", :force => true do |t| t.column "customer_id", :integer, :null => false @@ -35,12 +35,6 @@ ActiveRecord::Schema.define(:version => 16) do t.column "price", :decimal, :precision => 8, :scale => 2, :default => 0.0 end - create_table "purchases", :force => true do |t| - t.column "customer_id", :integer - t.column "purchaseable_id", :integer - t.column "purchaseable_type", :string - end - create_table "rentables", :force => true do |t| t.column "type", :string t.column "title", :string diff --git a/test/fixtures/purchases.yml b/test/fixtures/purchases.yml deleted file mode 100644 index b49c4eb..0000000 --- a/test/fixtures/purchases.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -one: - id: 1 -two: - id: 2 diff --git a/test/unit/purchase_test.rb b/test/unit/purchase_test.rb deleted file mode 100644 index f9a5498..0000000 --- a/test/unit/purchase_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class PurchaseTest < Test::Unit::TestCase - fixtures :purchases - - # Replace this with your real tests. - def test_truth - assert true - end -end -- 2.25.1