spec/spec_helper.rb in joost-searchlogic-2.1.7.1 vs spec/spec_helper.rb in joost-searchlogic-2.2.3.1
- old
+ new
@@ -24,19 +24,33 @@
t.string :username
t.string :name
t.integer :age
end
+ create_table :carts do |t|
+ t.datetime :created_at
+ t.datetime :updated_at
+ t.integer :user_id
+ end
+
create_table :orders do |t|
t.datetime :created_at
t.datetime :updated_at
t.integer :user_id
t.date :shipped_on
t.float :taxes
t.float :total
end
+ create_table :fees do |t|
+ t.datetime :created_at
+ t.datetime :updated_at
+ t.string :owner_type
+ t.integer :owner_id
+ t.float :cost
+ end
+
create_table :line_items do |t|
t.datetime :created_at
t.datetime :updated_at
t.integer :order_id
t.float :price
@@ -54,15 +68,18 @@
end
class User < ActiveRecord::Base
belongs_to :company, :counter_cache => true
has_many :orders, :dependent => :destroy
- alias_scope :username_has, lambda { |value| username_like(value) }
end
class Order < ActiveRecord::Base
belongs_to :user
has_many :line_items, :dependent => :destroy
+ end
+
+ class Fee < ActiveRecord::Base
+ belongs_to :owner, :polymorphic => true
end
class LineItem < ActiveRecord::Base
belongs_to :order
end