1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Mapper#resource and resources are both public methods

This commit is contained in:
Akira Matsuda 2020-10-27 00:52:38 +09:00
parent fbe7bcf1d6
commit b37473ebbd

View file

@ -1704,20 +1704,20 @@ module ActionDispatch
def apply_common_behavior_for(method, resources, options, &block)
if resources.length > 1
resources.each { |r| send(method, r, options, &block) }
resources.each { |r| public_send(method, r, options, &block) }
return true
end
if options[:shallow]
options.delete(:shallow)
shallow do
send(method, resources.pop, options, &block)
public_send(method, resources.pop, options, &block)
end
return true
end
if resource_scope?
nested { send(method, resources.pop, options, &block) }
nested { public_send(method, resources.pop, options, &block) }
return true
end
@ -1728,7 +1728,7 @@ module ActionDispatch
scope_options = options.slice!(*RESOURCE_OPTIONS)
unless scope_options.empty?
scope(scope_options) do
send(method, resources.pop, options, &block)
public_send(method, resources.pop, options, &block)
end
return true
end