This project is archived and is in readonly mode.

#3357 ✓stale
Philippe Creux

[PATCH] ActiveResource Preserve prefix on load

Reported by Philippe Creux | October 8th, 2009 @ 05:52 PM

This patch permits to preserve the prefix when loading attributes not containing the prefix.

The bug was the following:

class Person < ActiveResource::Base
  self.site = "http://37s.sunrise.i:3000"
end

class StreetAddress < ActiveResource::Base
  self.site = "http://37s.sunrise.i:3000/people/:person_id/"
  self.element_name = 'address'
end

address = StreetAddress.find(1, :params => { :person_id => 1 })
ryan = Person.new(:id => 1, :name => 'Ryan', :address => address)
# address.prefix_options => {:person_id => 1 }
address.load(:city => 'Vancouver')
# address.prefix_options => {} # should be {:person_id => 1 }

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages