提交 d3ec4b1b 编写于 作者: J José Valim

Revert "Use path_names, not resource_path_names, consistently"

Breaks tests on Ruby 1.8.7.
This reverts commit 13bbf98d.
上级 13bbf98d
...@@ -372,7 +372,7 @@ def merge_controller_scope(parent, child) ...@@ -372,7 +372,7 @@ def merge_controller_scope(parent, child)
@scope[:module] ? "#{@scope[:module]}/#{child}" : child @scope[:module] ? "#{@scope[:module]}/#{child}" : child
end end
def merge_path_names_scope(parent, child) def merge_resources_path_names_scope(parent, child)
merge_options_scope(parent, child) merge_options_scope(parent, child)
end end
...@@ -521,7 +521,7 @@ def member_name ...@@ -521,7 +521,7 @@ def member_name
def initialize(*args) #:nodoc: def initialize(*args) #:nodoc:
super super
@scope[:path_names] = @set.resources_path_names @scope[:resources_path_names] = @set.resources_path_names
end end
def resource(*resources, &block) def resource(*resources, &block)
...@@ -637,7 +637,7 @@ def match(*args) ...@@ -637,7 +637,7 @@ def match(*args)
return self return self
end end
path_names = options.delete(:path_names) resources_path_names = options.delete(:path_names)
if args.first.is_a?(Symbol) if args.first.is_a?(Symbol)
action = args.first action = args.first
...@@ -654,7 +654,7 @@ def match(*args) ...@@ -654,7 +654,7 @@ def match(*args)
end end
else else
with_exclusive_name_prefix(action) do with_exclusive_name_prefix(action) do
return match("#{action_path(action, path_names)}(.:format)", options.reverse_merge(:to => action)) return match("#{action_path(action, resources_path_names)}(.:format)", options.reverse_merge(:to => action))
end end
end end
end end
...@@ -682,7 +682,7 @@ def parent_resource #:nodoc: ...@@ -682,7 +682,7 @@ def parent_resource #:nodoc:
private private
def action_path(name, path_names = nil) def action_path(name, path_names = nil)
path_names ||= @scope[:path_name] path_names ||= @scope[:resources_path_names]
path_names[name.to_sym] || name.to_s path_names[name.to_sym] || name.to_s
end end
...@@ -693,7 +693,7 @@ def apply_common_behavior_for(method, resources, options, &block) ...@@ -693,7 +693,7 @@ def apply_common_behavior_for(method, resources, options, &block)
end end
if path_names = options.delete(:path_names) if path_names = options.delete(:path_names)
scope(:path_names => path_names) do scope(:resources_path_names => path_names) do
send(method, resources.pop, options, &block) send(method, resources.pop, options, &block)
end end
return true return true
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册