public
Rubygem
Fork of sam/dm-more
Description: Extras for DataMapper, including bridges to DataObjects::Migrations and Merb::DataMapper
Homepage: http://datamapper.org
Clone URL: git://github.com/dysinger/dm-more.git
Search Repo:
Updated to use less fragile auto-migrate.
sam (author)
Thu May 08 15:42:36 -0700 2008
commit  fc6f4453adc66839f996acecff7e225718399510
tree    4beafadcbc29bb7f930f502713c1497203496bc2
parent  1569d96fa9c302ce85b327c5d9fd6fc9c20b1756
...
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
...
36
37
38
39
 
 
40
41
 
42
43
44
...
18
19
20
 
 
 
 
 
 
 
 
 
 
21
22
23
24
...
26
27
28
 
29
30
31
 
32
33
34
35
0
@@ -18,16 +18,6 @@
0
 
0
   describe "Aggregates" do
0
     before(:all) do
0
-
0
- repository(:sqlite3).adapter.execute(<<-EOS.compress_lines) rescue nil
0
- DROP TABLE 'dragons';
0
- CREATE TABLE 'dragons' (
0
- "id" INT PRIMARY KEY,
0
- "name" VARCHAR(30),
0
- "is_fire_breathing" TINYINT,
0
- "toes_on_claw" SMALLINT(3)
0
- );
0
- EOS
0
       
0
       class Dragon
0
         include DataMapper::Resource
0
0
@@ -36,9 +26,10 @@
0
         property :is_fire_breathing, TrueClass
0
         property :toes_on_claw, Fixnum
0
       end
0
-
0
+
0
+ Dragon.auto_migrate!(:sqlite3)
0
 
0
- repository(:sqlite3) do
0
+ repository(:sqlite3) do
0
         Dragon.new(:name => 'George', :is_fire_breathing => false, :toes_on_claw => 3).save
0
         Dragon.new(:name => 'Puff', :is_fire_breathing => true, :toes_on_claw => 4).save
0
         Dragon.new(:name => 'Anzu', :is_fire_breathing => true, :toes_on_claw => 5).save

Comments

    No one has commented yet.