Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

map.resources does not work well when multiple entities provided

#794

when I write routes like this in routes.rb

map.resources :books,:users,:requirements=>{:id => /\d+/}

the requirements only work for ":books"---the first entitiy provided.

The "hash shallow copy" arose this bug. (:requirements=>{:id => /\d+/} is a nested hash)

code from actionpack\lib\actioncontroller\resources.rb

def resource(*entities, &block)
  options = entities.extract_options!
  entities.each { |entity| map_singleton_resource(entity, options.dup, &block) }
end

I mean that , we should pass a deep copy of options to method "map_singleton_resource", not "options.dup" which is shallow copy.

Reported by dazuiba · August 11th, 2008 @ 02:18 AM

State: wontfix
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. josh
    josh
    • State changed from new to wontfix

    Got patch+tests?

    November 22nd, 2008 @ 07:37 PM