Ah lame I totally just patched this.

Maybe we could fix validates_numericality_of? Rather than changing
every field helper because of one case? I suppose it is more difficult
that way around however.

The docs really do make it seem like it calls the method. So we'd need
to remember to change those :)

On 5/22/07, Michael Koziarski <[EMAIL PROTECTED]> wrote:
>
> > There must have been some reason for this behavior.
>
> validates_numericality_of
>
> if you have an integer field, and the user types in "a12345" instead
> of "12345".  When displaying error messages you want to display the
> value before it was typecast, otherwise it'd just be set to 0.  So the
> field helper doesn't look directly in the database, it uses
> price_before_type_cast, if it exists.
>
> So the behaviour is intentional, if somewhat opaque.   Perhaps what's
> needed is a way to make it easier to wrap attributes with custom
> accessors and mutators?
> --
> Cheers
>
> Koz
>
> >
>


-- 
Nik Wakelin
(027) 424 5433
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to