diff options
author | Akshay Vishnoi <akshay.vishnoi@vinsol.com> | 2013-11-15 01:37:33 +0530 |
---|---|---|
committer | Akshay Vishnoi <akshay.vishnoi@vinsol.com> | 2013-11-15 01:37:33 +0530 |
commit | dbcd0850136d3b27532e5699b23c78ca7965e670 (patch) | |
tree | 10b2b4663122a488088a9d8e3ce1fe72a1c43270 /actionpack | |
parent | fdf36d8110d92f038c2a37a5282f198e3a454540 (diff) | |
download | rails-dbcd0850136d3b27532e5699b23c78ca7965e670.tar.gz rails-dbcd0850136d3b27532e5699b23c78ca7965e670.tar.bz2 rails-dbcd0850136d3b27532e5699b23c78ca7965e670.zip |
avoiding next statements
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index cd5220548c..f4140f21f5 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -147,14 +147,16 @@ module ActionDispatch @defaults.merge!(options[:defaults]) if options[:defaults] options.each do |key, default| - next if Regexp === default || IGNORE_OPTIONS.include?(key) - @defaults[key] = default + unless Regexp === default || IGNORE_OPTIONS.include?(key) + @defaults[key] = default + end end if options[:constraints].is_a?(Hash) options[:constraints].each do |key, default| - next unless URL_OPTIONS.include?(key) && (String === default || Fixnum === default) - @defaults[key] ||= default + if URL_OPTIONS.include?(key) && (String === default || Fixnum === default) + @defaults[key] ||= default + end end end @@ -169,15 +171,16 @@ module ActionDispatch @conditions.merge!(:path_info => path) constraints.each do |key, condition| - next if segment_keys.include?(key) || key == :controller - @conditions[key] = condition + unless segment_keys.include?(key) || key == :controller + @conditions[key] = condition + end end @conditions[:required_defaults] = [] options.each do |key, required_default| - next if segment_keys.include?(key) || IGNORE_OPTIONS.include?(key) - next if Regexp === required_default - @conditions[:required_defaults] << key + unless segment_keys.include?(key) || IGNORE_OPTIONS.include?(key) || Regexp === required_default + @conditions[:required_defaults] << key + end end via_all = options.delete(:via) if options[:via] == :all |