On Thursday, December 29, 2016 at 7:23:08 AM UTC-8, Quackerjack wrote:
>
> Hey,
>
> is there an update method i can use on objects which doesn't trigger model 
> callbacks in sequel?
>
> All methods i know - 'update', 'update_all' and 'save' - trigger callback 
> runs.
>
> Thx in advance!
>

In Sequel, you can bypass validation, but not hooks.  Many plugins are 
implemented using hooks, and skipping the hooks would break code that uses 
such plugins.

You would have to set a flag before saving and modify your hook code to 
check it:

class Foo < Sequel::Model
  def after_save
    super
    return if @skip_hooks
    # ...
  end

  def skip_hooks!
    @skip_hooks = true
  end
end

-- 
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 https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to