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:
Code clean-up behavior.rb

Modified the extraction of :controller and :action to be much more
civilized and not require a loop through all keys.

All Tests Pass

  modified:   lib/merb-core/dispatch/router/behavior.rb

Signed-off-by: Michael S. Klishin <michael@novemberain.com>
startrader (author)
Fri May 16 09:48:27 -0700 2008
Michael S. Klishin (committer)
Fri May 16 15:11:53 -0700 2008
commit  28d86fa31c6409e406d96c6b0642e8d3e27644b6
tree    ecb41a5a1316104e19ab176d183982ceda438fc1
parent  6b3fa01328ada93ac37c34173f2dbfde168d13c9
...
176
177
178
179
180
181
 
 
182
183
184
...
176
177
178
 
 
 
179
180
181
182
183
0
@@ -176,9 +176,8 @@
0
       # Behavior:: The new behavior.
0
       def match_without_path(conditions = {})
0
         params = conditions.delete(:params) || {} #parents params will be merged in Route#new
0
- params[:controller] = conditions.delete(:controller) || params[:controller]
0
- params[:action] = conditions.delete(:action) || params[:action]
0
- params.delete_if{|_k,value| value.nil?}
0
+ params[:controller] = conditions.delete(:controller) if conditions[:controller]
0
+ params[:action] = conditions.delete(:action) if conditions[:action]
0
         new_behavior = self.class.new(conditions, params, self)
0
         yield new_behavior if block_given?
0
         new_behavior

Comments

    No one has commented yet.