public
Rubygem
Description: Extras for DataMapper, including bridges to DataObjects::Migrations and Merb::DataMapper
Homepage: http://datamapper.org
Clone URL: git://github.com/sam/dm-more.git
Search Repo:
Added spec for changes in dm-core da8cd46. Resolves #327.
Tue Jul 22 15:26:48 -0700 2008
commit  3e735915b0809189b34348f14c1a3e262af896a9
tree    fff931ff9c120fe51cfe206a0ef8646dc90c61cf
parent  707207883f7281655e9c4d18c5c6de5e768a6dc2
...
349
350
351
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
...
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
0
@@ -349,4 +349,24 @@ describe DataMapper::Validate do
0
 
0
     Raft.new(10).validation_property_value("length").should == 10
0
   end
0
+
0
+ it "should duplicate validations to STI models" do
0
+ class Company
0
+ include DataMapper::Resource
0
+
0
+ validates_present :title, :message => "Company name is a required field"
0
+
0
+ property :id, Integer, :serial => true, :key => true
0
+ property :title, String
0
+ property :type, Discriminator
0
+ end
0
+
0
+ class ServiceCompany < Company
0
+ end
0
+
0
+ class ProductCompany < Company
0
+ end
0
+ company = ServiceCompany.new
0
+ company.should_not be_valid
0
+ end
0
 end

Comments

    No one has commented yet.