This bit me just now too.  It seems to happen even if you say "has
n, :through => Resource," and try to save the parent with a context.
It appears to be requiring the parent's context to exist on the join
modelI'm currently on Datamapper 0.10.0.

Is this the expected behavior?

-J

On Oct 23, 10:53 pm, MarkMT <[email protected]> wrote:
> I'm in the process of using contextual validations for the first time,
> and I've discovered that if I save an object that has children, the
> children will be saved with the same context as the primary object.
> However, if there's no validation declared for the child with that
> particular context, an exception will be raised.
>
> I can see that if the child has a validation defined for the context
> specified when the primary object is saved, then it absolutely makes
> sense to run that. But it's not clear to me that you should actually
> be required to have a validation defined on the child for that
> context. And if the child doesn't actually require validation, I guess
> you would have to add a validates_with_block with an empty block.
>
> Is this the intended behavior, or something worth changing?
>
> Mark.

--

You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=.


Reply via email to