Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source
Show
Ignore:
Timestamp:
03/17/08 23:45:42 (8 months ago)
Author:
david
Message:

Fixed that polymorphic routes would modify the input array (closes #11363) [thomas.lee]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/polymorphic_routes.rb

    r8741 r9053  
    6969    # 
    7070    def polymorphic_url(record_or_hash_or_array, options = {}) 
     71      if record_or_hash_or_array.kind_of?(Array) 
     72        record_or_hash_or_array = record_or_hash_or_array.dup 
     73      end 
     74 
    7175      record    = extract_record(record_or_hash_or_array) 
    7276      format    = (options[:action].to_s == "formatted" and record_or_hash_or_array.pop)