Hey Jeremy, thank you for your answer. What do you think about this solution?
Sequel::Model.plugin :subclasses do |sub_class| sub_class.skip_auto_validations(:unique) end Dne středa 1. září 2021 v 16:38:45 UTC+2 uživatel Jeremy Evans napsal: > On Wed, Sep 1, 2021 at 6:14 AM '[email protected]' via sequel-talk < > [email protected]> wrote: > >> Hi, >> how can I disable/skip unique auto validations on all models? >> >> I've tried Sequel::Model.skip_auto_validations(:unique) but it's not >> working... >> > > skip_auto_validations only affects the specific model you call it on, it > doesn't affect all subclasses. > > The simplest way is probably the following after loading the plugin: > > def (Sequel::Model).auto_validate_unique_columns > [] > end > > 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 view this discussion on the web visit https://groups.google.com/d/msgid/sequel-talk/986f6a5e-3f5f-4b52-aec2-9582d4a1a020n%40googlegroups.com.
