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

Changeset 7082

Show
Ignore:
Timestamp:
06/22/07 18:15:40 (1 year ago)
Author:
bitsweat
Message:

Fix reload error when path prefix is used. Closes #8727.

Files:

Legend:

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

    r6980 r7082  
    11*SVN* 
     2 
     3* Fix reload error when path prefix is used.  #8727 [Ian Warshak] 
    24 
    35* Remove ActiveResource::Struct because it hasn't proven very useful. Creating a new ActiveResource::Base subclass is often less code and always clearer.  #8612 [Josh Peek] 
  • trunk/activeresource/lib/active_resource/base.rb

    r6972 r7082  
    295295    # Reloads the attributes of this object from the remote web service. 
    296296    def reload 
    297       self.load(self.class.find(id, @prefix_options).attributes) 
     297      self.load(self.class.find(id, :params => @prefix_options).attributes) 
    298298    end 
    299299 
  • trunk/activeresource/test/base_test.rb

    r7074 r7082  
    294294    assert_equal address.prefix_options, ryan.address.prefix_options 
    295295  end 
     296   
     297  def test_reload_works_with_prefix_options 
     298    address = StreetAddress.find(1, :params => { :person_id => 1 }) 
     299    assert_equal address, address.reload 
     300  end 
     301   
     302  def test_reload_works_without_prefix_options     
     303    person = Person.find(:first) 
     304    assert_equal person, person.reload 
     305  end 
     306     
    296307 
    297308  def test_create