Hi Jeremy,

I have been using the touch plugin to update the timestamps on records when 
many_to_many associations are added or removed (to support caching for the 
web). 

First of all, is this an anti pattern? 

If not, there is an annoying gotcha:

The touch method takes a column argument and the after_add and after_remove 
hooks send the associated record as an argument. Including :touch as a 
callback results in no column being updated. Instead, one needs to create a 
wrapper method that calls touch with no arguments.

Best,

Jamie

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sequel-talk/-/rfcWyg7b6jkJ.
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/sequel-talk?hl=en.

Reply via email to