Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATCH] ActiveResource Preserve prefix on load

#3357

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 }

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

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Rohit Arondekar
    Rohit Arondekar
    • 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.

    October 6th, 2010 @ 06:38 AM

  2. bingbing
  3. nosretep
    nosretep

    This is still an issue on ActiveResource 3.0.5

    jruby-1.6.0
    rails 3.0.5

    April 12th, 2011 @ 05:26 AM