Steve, It's easy to reply to your post, because you have a code example :) In you case, you will have to duplicate all checks in your custom validations, that is not DRY approach.
You will duplicate .to_i in all methods that will depends on age as integer. On Thursday, June 21, 2012 3:51:42 PM UTC+3, Steve Klabnik wrote: > > I think I'd be much more annoyed by this kind of behavior. "Okay, > these two things are wrong. Let's fix them. Wait, now it's _still_ > wrong, with something totally unrelated?" > > You could fix this case almost trivially by 'if age.to_i < 16', right? > I mean, I know you're talking about a more general case, but... > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/egXIJW9e7xYJ. 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.
