Since we are deleting options, make sure we dup the hash before sending it to each mapping.

This commit is contained in:
José Valim
2009-11-13 09:35:43 -02:00
parent 836770a9f2
commit bb32a42966

View File

@@ -79,10 +79,12 @@ module ActionController::Routing
resources.map!(&:to_sym)
resources.each do |resource|
mapping = Devise::Mapping.new(resource, options)
mapping = Devise::Mapping.new(resource, options.dup)
Devise.mappings[mapping.name] = mapping
with_options(mapping.route_options.dup.update(:path_prefix => mapping.raw_path, :name_prefix => "#{mapping.name}_")) do |routes|
route_options = mapping.route_options.merge(:path_prefix => mapping.raw_path, :name_prefix => "#{mapping.name}_")
with_options(route_options) do |routes|
mapping.for.each do |strategy|
send(strategy, routes, mapping) if self.respond_to?(strategy, true)
end