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

Ticket #11510 (new defect)

Opened 1 month ago

Last modified 1 month ago

[PATCH] validates_uniqueness_of fails on non-string values

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

Description

validates_uniqueness_of fails on non-string values. And this is because of a call to downcase.

Seems to have been added in r9160

You should to_s things before you downcase them.

Attachments

validations.diff (0.7 kB) - added by igotimac on 04/02/08 15:14:30.
patch to add to_s

Change History

04/02/08 15:14:30 changed by igotimac

  • attachment validations.diff added.

patch to add to_s

04/02/08 15:16:25 changed by igotimac

  • summary changed from validations validates_uniqueness_of fails on non-string values to [PATCH] validates_uniqueness_of fails on non-string values.

04/03/08 19:04:07 changed by danielmorrison

+1 though it would be better with a test case.

This acts as a regression, as the default has changed so non-string values are likely to get hit with the downcase.