On Aug 25, 5:05 pm, Aman Gupta <themastermi...@gmail.com> wrote:
> after_update hooks are only invoked when you use Model#update, not
> Dataset#update. There's no way to know which model instances were affected
> by a dataset update.

Aman is correct.  If you want the after_update hooks run, you need to
do:

  Post.filter(:id => parent_id).all do |p|
    p.update(:comment_count => p.comment_count+1)
  end

Note that that will be a lot slower than the dataset way for large
datasets.

Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to sequel-talk@googlegroups.com
To unsubscribe from this group, send email to 
sequel-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to