提交 175280cc 编写于 作者: A Aaron Patterson

pull scope[:constraints] up

Now we only need to call `split_constraints` possibly twice!
上级 0988ad0f
......@@ -74,11 +74,12 @@ def self.build(scope, set, path, as, controller, default_action, to, options)
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 @@ def initialize(scope, set, path, defaults, as, controller, default_action, modyo
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])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册