aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-08-11 18:06:41 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-08-11 18:06:54 -0700
commit175280ccb5eff69815f5dcac3a43f4d4c41eea24 (patch)
tree8b161b40f4ba05e96d49c2c27d84e687775a507f
parent0988ad0fa799f6d97a9d906b6fa4d5dd3cb2987d (diff)
downloadrails-175280ccb5eff69815f5dcac3a43f4d4c41eea24.tar.gz
rails-175280ccb5eff69815f5dcac3a43f4d4c41eea24.tar.bz2
rails-175280ccb5eff69815f5dcac3a43f4d4c41eea24.zip
pull scope[:constraints] up
Now we only need to call `split_constraints` possibly twice!
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 2b6c655d08..bffcd8fc54 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -74,11 +74,12 @@ module ActionDispatch
options.delete :format
defaults = (scope[:defaults] || {}).dup
+ scope_constraints = scope[:constraints] || {}
- new scope, set, path, defaults, as, controller, default_action, scope[:module], to, formatted, options
+ new scope, set, path, defaults, as, controller, default_action, scope[:module], to, formatted, scope_constraints, options
end
- def initialize(scope, set, path, defaults, as, controller, default_action, modyoule, to, formatted, options)
+ def initialize(scope, set, path, defaults, as, controller, default_action, modyoule, to, formatted, scope_constraints, options)
@requirements, @conditions = {}, {}
@defaults = defaults
@set = set
@@ -98,11 +99,9 @@ module ActionDispatch
options = normalize_options!(options, formatted, path_params, ast, modyoule)
-
- split_constraints(path_params, scope[:constraints]) if scope[:constraints]
constraints = constraints(options, path_params)
- split_constraints path_params, constraints
+ split_constraints path_params, scope_constraints.merge(constraints)
@blocks = blocks(options_constraints, scope[:blocks])