Added date_available_from to products, updated conditions in product.find_products_fo...
[depot.git] / db / migrate / 20090226212307_add_more_test_data.rb
1 class AddMoreTestData < ActiveRecord::Migration
2 def self.up
3 Product.create(:title => 'Rainbow',
4 :description =>
5 %{<p>What could be better than a beautiful rainbow to brighten up your
6 day? Experience the wonder of light and water in all its glory.
7 </p>
8 <p>Due to metreological variations, the rainbow you receive may
9 differ slightly from the one shown here.
10 </p>
11 <p>(Terminal gold not included.)
12 </p>
13 },
14 :image_url => '/images/rainbow.jpg',
15 :price => 17.99,
16 :date_available => Time.utc(2008, 12, 31),
17 :date_available_until => Time.utc(2009, 1, 1)
18 # :available_until => 'fred'
19 # :au => Time.utc(2008, 12, 31)
20 )
21
22 box = Product.find(3)
23 box.update_attribute(:date_available_until, Time.utc(2010, 7, 1))
24 # box.update_attribute(:available_until, 'tom')
25 # box.update_attribute(:au, Time.utc(2010, 7, 1))
26 end
27
28 def self.down
29 Product.delete_all(["title = ?", 'Rainbow'])
30 end
31 end