This project is archived and is in readonly mode.
[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
-
Rohit Arondekar October 6th, 2010 @ 06:38 AM
- State changed from new to stale
- Importance changed from to
Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.
-
nosretep April 12th, 2011 @ 05:26 AM
This is still an issue on ActiveResource 3.0.5
jruby-1.6.0
rails 3.0.5
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>