Revert "Revert "Use path_names, not resource_path_names, consistently""
This reverts commit d3ec4b1ba6528a081f5124fd71cc026b1f8abe9c.
This commit is contained in:
parent
5850edf104
commit
381f877bbb
@ -372,7 +372,7 @@ def merge_controller_scope(parent, child)
|
||||
@scope[:module] ? "#{@scope[:module]}/#{child}" : child
|
||||
end
|
||||
|
||||
def merge_resources_path_names_scope(parent, child)
|
||||
def merge_path_names_scope(parent, child)
|
||||
merge_options_scope(parent, child)
|
||||
end
|
||||
|
||||
@ -521,7 +521,7 @@ def member_name
|
||||
|
||||
def initialize(*args) #:nodoc:
|
||||
super
|
||||
@scope[:resources_path_names] = @set.resources_path_names
|
||||
@scope[:path_names] = @set.resources_path_names
|
||||
end
|
||||
|
||||
def resource(*resources, &block)
|
||||
@ -637,7 +637,7 @@ def match(*args)
|
||||
return self
|
||||
end
|
||||
|
||||
resources_path_names = options.delete(:path_names)
|
||||
path_names = options.delete(:path_names)
|
||||
|
||||
if args.first.is_a?(Symbol)
|
||||
action = args.first
|
||||
@ -654,7 +654,7 @@ def match(*args)
|
||||
end
|
||||
else
|
||||
with_exclusive_name_prefix(action) do
|
||||
return match("#{action_path(action, resources_path_names)}(.:format)", options.reverse_merge(:to => action))
|
||||
return match("#{action_path(action, path_names)}(.:format)", options.reverse_merge(:to => action))
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -682,7 +682,7 @@ def parent_resource #:nodoc:
|
||||
|
||||
private
|
||||
def action_path(name, path_names = nil)
|
||||
path_names ||= @scope[:resources_path_names]
|
||||
path_names ||= @scope[:path_names]
|
||||
path_names[name.to_sym] || name.to_s
|
||||
end
|
||||
|
||||
@ -693,7 +693,7 @@ def apply_common_behavior_for(method, resources, options, &block)
|
||||
end
|
||||
|
||||
if path_names = options.delete(:path_names)
|
||||
scope(:resources_path_names => path_names) do
|
||||
scope(:path_names => path_names) do
|
||||
send(method, resources.pop, options, &block)
|
||||
end
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user