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

Ticket #11603 (new defect)

Opened 4 weeks ago

Last modified 4 weeks ago

Association Preload assumes keys are integers

Reported by: cch1 Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveRecord Version: edge
Severity: normal Keywords: [TRIVIAL] cast integer key
Cc:

Description

In three different places in the association preload code, foreign keys are converted to integers (to_i). In addition to being unnecessary (nowhere else in AR are keys forced to integers), this casting breaks all manner of code using non-integer keys.

Attachments

stop_casting_association_keys.diff (1.7 kB) - added by cch1 on 04/21/08 16:32:44.

Change History

04/21/08 16:32:44 changed by cch1

  • attachment stop_casting_association_keys.diff added.

04/21/08 20:41:31 changed by cch1

Note that this patch is not appropriate for Edge Rails.

04/21/08 20:42:30 changed by cch1