aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-10-21 15:14:25 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-11-18 10:51:10 -0800
commit33543ac87148cfdd5b1917a0698bccaf55690e28 (patch)
treeadfbf0d636a7c128f19552a824f5fab397eb1ce3 /actionpack/lib
parent648f6113d1f0c6f9cdb2352a24e84c2c204d564b (diff)
downloadrails-33543ac87148cfdd5b1917a0698bccaf55690e28.tar.gz
rails-33543ac87148cfdd5b1917a0698bccaf55690e28.tar.bz2
rails-33543ac87148cfdd5b1917a0698bccaf55690e28.zip
stop doing is_a? checks on the resource type
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index f49155349c..91220e1cf7 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -986,7 +986,7 @@ module ActionDispatch
return self
end
- resource_scope(SingletonResource.new(resources.pop, options)) do
+ resource_scope(:resource, SingletonResource.new(resources.pop, options)) do
yield if block_given?
collection do
@@ -1117,7 +1117,7 @@ module ActionDispatch
return self
end
- resource_scope(Resource.new(resources.pop, options)) do
+ resource_scope(:resources, Resource.new(resources.pop, options)) do
yield if block_given?
collection do
@@ -1387,8 +1387,8 @@ module ActionDispatch
@scope[:scope_level_resource] = old_resource
end
- def resource_scope(resource) #:nodoc:
- with_scope_level(resource.is_a?(SingletonResource) ? :resource : :resources, resource) do
+ def resource_scope(level, resource) #:nodoc:
+ with_scope_level(level, resource) do
scope(parent_resource.resource_scope) do
yield
end