On Monday, January 13, 2014 10:14:24 PM UTC-8, Andrew Hacking wrote:
>
> e, I've already said I like core kept clean. I'm taking a pure plugin 
> approach.
>
> Yes I've already had problems with instance_hooks in nested_attributes as 
> they don't work if you do model.valid? followed by a model.save as they are 
> one shot and get cleared as per the docs. Nested attributes probably should 
> have a note about that since it leverages the behavior of instance_hooks.
>
The way the instance_hooks plugin currently works is that after the after 
hooks of a given type run, it clears both the after and before hooks for 
that type.  So the before_validation and after_validation instance hooks 
get cleared after the after_validation instance hooks run, which is before 
save.  However, this behavior is not specced, it is an implementation 
detail.  It can and probably should be changed to not clear the validation 
instance hooks until after a successful save.  I'll implement that soon.
 
Thanks,
Jeremy 

>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to