diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-10-21 15:14:25 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-11-18 10:51:10 -0800 |
commit | 33543ac87148cfdd5b1917a0698bccaf55690e28 (patch) | |
tree | adfbf0d636a7c128f19552a824f5fab397eb1ce3 /actionpack/lib/action_dispatch/routing/mapper.rb | |
parent | 648f6113d1f0c6f9cdb2352a24e84c2c204d564b (diff) | |
download | rails-33543ac87148cfdd5b1917a0698bccaf55690e28.tar.gz rails-33543ac87148cfdd5b1917a0698bccaf55690e28.tar.bz2 rails-33543ac87148cfdd5b1917a0698bccaf55690e28.zip |
stop doing is_a? checks on the resource type
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 8 |
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 |