> I think it would be more obvious when reading your code if you just called 
> #sum_lines before calling #save, since it would't be clear why you were 
> calling #save otherwise.
>
> You *can* hook into other methods, like valid? and dirty?, but having 
> side-effects here is probably not desirable:
>
> before :dirty?, :sum_lines

Yes, that's what I was thinking, removing the hook from the model and
call it from the outside.

I just thought that hooks were always executed, but that's not the
case.

Thanks for the information anyway :)

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
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/datamapper?hl=en.

Reply via email to