Permalink
Browse files

Route#format: optimize method

  • Loading branch information...
1 parent b50b21f commit 668790157558bcc922ed7d3c570caa0d704787f7 @bogdan bogdan committed May 21, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/journey/route.rb
View
@@ -67,8 +67,8 @@ def parts
alias :segment_keys :parts
def format path_options
- (defaults.keys - required_parts).each do |key|
- path_options.delete key if defaults[key].to_s == path_options[key].to_s
+ path_options.delete_if do |key, value|
+ value.to_s == defaults[key].to_s && !required_parts.include?(key)
end
formatter = Visitors::Formatter.new(path_options)

0 comments on commit 6687901

Please sign in to comment.