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

Ticket #7353 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Fix ActiveResource::Base.load to properly account for prefix_options

Reported by: rwdaigle Assigned to: core
Priority: normal Milestone: 1.x
Component: ActiveResource Version: edge
Severity: normal Keywords:
Cc:

Description

Currently, creating a new ARes with member ARes attributes does not properly carry over the prefix_options of these member ARes attributes:

address = StreetAddress.find(1, :person_id => 1)
ryan = Person.new(:id => 1, :name => 'Ryan', :address => address)
ryan.address.prefix_options  #=> {}

This patch ensures that the prefix_options of ARes member attributes are retained.

address = StreetAddress.find(1, :person_id => 1)
ryan = Person.new(:id => 1, :name => 'Ryan', :address => address)
ryan.address.prefix_options  #=> {:person_id => 1}

Attachments

activeresource_load_patch.diff (1.1 kB) - added by rwdaigle on 01/24/07 16:40:39.
Fixes ActiveResource::Base.load to retain prefix_options of child ARes attributes

Change History

01/24/07 16:40:39 changed by rwdaigle

  • attachment activeresource_load_patch.diff added.

Fixes ActiveResource::Base.load to retain prefix_options of child ARes attributes

01/24/07 18:27:38 changed by bitsweat

  • status changed from new to closed.
  • resolution set to fixed.

(In [6032]) Loading a resource preserves its prefix_options. Closes #7353. Silence prefix redefinition warnings; fix type in logged error.