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

Ticket #10971 (new enhancement)

Opened 1 year ago

Last modified 1 year ago

[PATCH] Add [] bracket attribute accessor method to Active Resource

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

Description

I was using auto_complete plugin and got an error NoMethod on [] for an Active Resource instance object. I added this simple [] attribute accessor to ActiveResource::Base. Adding the [] method increases ActiveRecord mimicry.

Attachments

add_bracket_method_to_active_resource.diff (0.5 kB) - added by rubyisbeautiful on 01/31/08 14:20:49.
diff patch for active resource to add [] method
add_bracket_methods_to_active_resource.diff (0.8 kB) - added by rubyisbeautiful on 02/04/08 15:00:10.
diff patch for active resource to add [] and []= methods

Change History

01/31/08 14:20:49 changed by rubyisbeautiful

  • attachment add_bracket_method_to_active_resource.diff added.

diff patch for active resource to add [] method

02/01/08 07:00:21 changed by hasmanyjosh

Looks cool. Perhaps you could also add a []= method too?

02/04/08 15:00:10 changed by rubyisbeautiful

  • attachment add_bracket_methods_to_active_resource.diff added.

diff patch for active resource to add [] and []= methods

02/04/08 15:00:58 changed by rubyisbeautiful

good idea :) I added the new patch.

02/09/08 15:24:18 changed by rubyisbeautiful

As this is my first patch/ticket, is there anything else I need to do?