public
Rubygem
Description: Merb Core: All you need. None you don't.
Homepage: http://www.merbivore.com
Clone URL: git://github.com/wycats/merb-core.git
Search Repo:
Needs to raise here since if the generator scope has more than one ORM the 
geneartors will not work.

If you need to use two orm's use_orm on one, and require the other's merb 
adapter.

Revert "Log instead of raising when dependencies mechanism this ORM 
required twice."

This reverts commit c866de0dbafa600248a8a2601785505e5e6ce621.
hassox (author)
Thu May 15 17:34:34 -0700 2008
commit  c903c92bb1fe1054c3f2ad7e7a748d1525300fc8
tree    a7996f919cdd665fb2a3388051a1203eb95a83f1
parent  c866de0dbafa600248a8a2601785505e5e6ce621
...
115
116
117
118
 
119
120
121
...
115
116
117
 
118
119
120
121
0
@@ -115,7 +115,7 @@
0
   # # This will use the DataMapper generator for your ORM
0
   # $ ruby script/generate model MyModel
0
   def use_orm(orm)
0
- Merb.logger.warn "Don't call use_orm more than once" unless Merb.generator_scope.include?(:merb_default)
0
+ raise "Don't call use_orm more than once" unless Merb.generator_scope.include?(:merb_default)
0
 
0
     begin
0
       register_orm(orm)
...
23
24
25
26
27
28
29
 
30
31
32
...
23
24
25
 
 
26
 
27
28
29
30
0
@@ -23,10 +23,8 @@
0
   end
0
 
0
   it "should raise an error if use_orm is called twice" do
0
- Merb.logger.should_receive(:warn)
0
-
0
     use_orm(:activerecord)
0
- use_orm(:datamapper)
0
+ lambda { use_orm(:datamapper) }.should raise_error("Don't call use_orm more than once")
0
   end
0
 
0
   it "should not have :merb_default in GENERATOR_SCOPE with use_orm(:activerecord)" do

Comments

  • michaelklishin Thu May 15 17:51:50 -0700 2008

    This caused DM automigration to fail with this exception for some reason and I am not sure why yet.