[Rails] Re: Multiple validations on a field... grouping them? only
Marnen Laibow-Koser wrote:
>
> If the two fields serve independent, unique purposes, then they will
> contain different data some of the time. If they can never, ever
> contain different data, then they are ipso facto not independent and
> should be merged.
>
> It's that simple.
>
The two fields serve independent, unique purposes, and they contain
different data. The only time I check for validation for exact data is
when the page being created calls a redirect to a controller - action.
In this case, I require the name and the controller to be exact for too
many reasons to explain or to go into this particular topic.
The point I was making is that you can't generalize a topic and correct
people on criteria you have no information about. You are making false
assumptions. If you saw all of my code you could make an informed
reply.
Validation is a tricky topic and there are many reasons people create
custom validations. The point I was making is that it can be done and
to make sure you don't muddy up the place you put your custom
validators. I understand your point on putting it in a module. I
disagree but in this case we can agree to disagree on the topic.
Thanks.
--
Posted via http://www.ruby-forum.com/.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home