GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

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
url(:foo, 3) should notice 3 is a Fixnum, and use it instead of 3.id
daikini (author)
Sun Mar 09 15:40:48 -0700 2008
ivey (committer)
Sun Mar 09 20:55:40 -0700 2008
commit  01b85241150e557106a73dae0500eebd1a2a9a46
tree    edfd9c599896020ff041a814e79955b44a601c7f
parent  1b663b88e39615ac0c08f0041fff8b33b0adbd20
...
117
118
119
 
 
120
121
122
...
117
118
119
120
121
122
123
124
0
@@ -117,6 +117,8 @@ module Merb
0
               else
0
                 if segment == :id && params.respond_to?(:to_param)
0
                   params.to_param
0
+ elsif segment == :id && params.is_a?(Fixnum)
0
+ params
0
                 elsif params.respond_to?(segment)
0
                   params.send(segment)
0
                 else
...
90
91
92
93
 
 
 
 
 
94
95
96
...
90
91
92
 
93
94
95
96
97
98
99
100
0
@@ -90,7 +90,11 @@ describe Merb::Controller, " url" do
0
   
0
   it "should match with an object as second arg" do
0
     @monkey = Monkey.new
0
- @controller.url(:monkey,@monkey).should == "/monkeys/45"
0
+ @controller.url(:monkey, @monkey).should == "/monkeys/45"
0
+ end
0
+
0
+ it "should match with a fixnum as second arg" do
0
+ @controller.url(:monkey, 3).should == "/monkeys/3"
0
   end
0
 
0
   it "should match the delete_monkey route" do

Comments

    No one has commented yet.