I don't think this would be a big deal to address, probably just a
couple of lines of code here and there, but it does sound like a bit
of an edge case to me, and I wouldn't want it to be abused. Your case
sounds valid, but I wouldn't want people building one huge rules file
for all of their objects and just counting on the framework to ignore
properties if they don't exist. So I'm not totally sure that it's a
good thing to add to the framework.
What do other folks think?
Bob
On Tue, Mar 15, 2011 at 9:41 AM, Jim Priest <pri...@thecrumb.com> wrote:
> I'm working on kind of an edge case here...
>
> I have a load of PDF's and noticed they return a nice PDF object so I
> was thinking I can run those through ValidateThis for some high level
> checks before saving them.
>
> Validation works but given the # of forms I have and the possible # of
> fields in them I'm wondering...
>
> What I'd like to do is say, "Validate this if the property exists"
> because I don't really want to write contexts for each form I have and
> the fields in it. Then I could simply have a huge rules file with all
> the possible fields...
>
> <objectProperties ignoreMissingProperty = "true"> :)
>
> Is there a way to do that with ValidateThis? I thought I read in the
> docs somewhere about ignoring rules or something like that but can't
> find it this morning.
>
> Thanks!
> Jim
>
> --
> You received this message because you are subscribed to the Google Groups "ValidateThis" group.
> To post to this group, send email to valida...@googlegroups.com.
> To unsubscribe from this group, send email to validatethis...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/validatethis?hl=en.
>
>
--
Bob Silverberg
www.silverwareconsulting.com
If we do like the idea we could consider adding a config option to
turn this feature on and off, but I'm also wary of adding more config
options.
What do folks think about this?
Cheers,
Bob
I have no opinion one way or the other, except to say that I like the
default behavior, and its presence has caused me to catch stupid bugs
earlier than I would have otherwise.
> You received this message because you are subscribed to the Google Groups "ValidateThis-dev" group.
> To post to this group, send email to validate...@googlegroups.com.
> To unsubscribe from this group, send email to validatethis-d...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/validatethis-dev?hl=en.
>
>
I like the default behaviour where it throws an exception.
Regarding the PDF object, could you mixin an onMissingMethod method,
which would could handle missing properties? (Yes, this is a complete
stab in the dark!)
--
You received this message because you are subscribed to the Google Groups "ValidateThis-dev" group.
To post to this group, send email to validate...@googlegroups.com.
To unsubscribe from this group, send email to validatethis-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/validatethis-dev?hl=en.
I'd vote for that
--
You received this message because you are subscribed to the Google Groups "ValidateThis-dev" group.
To post to this group, send email to validate...@googlegroups.com.
To unsubscribe from this group, send email to validatethis-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/validatethis-dev?hl=en.