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

Ticket #11295 (closed defect: fixed)

Opened 9 months ago

Last modified 8 months ago

[PATCH] validates_length_of using :within doesn't work with associations (or non strings)

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

Description

validates_length_of works well with associations if you use :maximum, :minimum and :is. Actually there's a test for it (test_validates_size_of_association). The attached patch includes a new test and the implementation that makes it work using :within / :in

This patch also solves #10019

Attachments

vlo_associations_using_within.diff (2.6 kB) - added by cavalle on 03/06/08 20:39:13.

Change History

03/06/08 20:39:13 changed by cavalle

  • attachment vlo_associations_using_within.diff added.

03/07/08 20:30:54 changed by demisone

+1 from me

03/18/08 21:45:09 changed by ernesto.jimenez

+1

03/19/08 10:24:06 changed by juanjo.bazan

  • keywords changed from patch to verified.

+1 Works for me. Tests OK.

03/29/08 17:53:48 changed by david

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

(In [9129]) Fixed that validates_size_of :within works in associations (closes #11295, #10019) [cavalle]