Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 6925

Show
Ignore:
Timestamp:
06/01/07 17:14:14 (1 year ago)
Author:
rick
Message:

pass the prefix_options to the instantiated record when using find without a specific id. Closes #8544 [alloy]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activeresource/CHANGELOG

    r6864 r6925  
    11*SVN* 
     2 
     3* pass the prefix_options to the instantiated record when using find without a specific id. Closes #8544 [alloy] 
    24 
    35* Recognize and raise an exception on 405 Method Not Allowed responses.  #7692 [Josh Peek] 
  • trunk/activeresource/lib/active_resource/base.rb

    r6703 r6925  
    162162            prefix_options, query_options = split_options(options[:params]) 
    163163            path = collection_path(prefix_options, query_options) 
    164             instantiate_collection(connection.get(path, headers) || []
     164            instantiate_collection( (connection.get(path, headers) || []), prefix_options
    165165          end 
    166166        end 
  • trunk/activeresource/test/base_test.rb

    r6703 r6925  
    314314  end 
    315315 
    316   def test_update_with_custom_prefix 
     316  def test_update_with_custom_prefix_with_specific_id 
    317317    addy = StreetAddress.find(1, :params => { :person_id => 1 }) 
    318318    addy.street = "54321 Street" 
     
    322322  end 
    323323 
     324  def test_update_with_custom_prefix_without_specific_id 
     325    addy = StreetAddress.find(:first, :params => { :person_id => 1 }) 
     326    addy.street = "54321 Lane" 
     327    assert_kind_of StreetAddress, addy 
     328    assert_equal "54321 Lane", addy.street 
     329    addy.save 
     330  end 
     331   
    324332  def test_update_conflict 
    325333    ActiveResource::HttpMock.respond_to do |mock|