To maintain consistency auto_validations plugin should also have something 
like validation_helper's `from` option

Dne neděle 22. března 2020 17:00:37 UTC+1 Petr Kaleta napsal(a):
>
> Hello, it looks like there's an issue when using both auto_validations and 
> defaults_setter plugin.
>
> I am using sequel 5.30.0
>
> Please have a look on the following example:
>
> create_table :foo_bars do
> primary_key :id
>
> column :name, 'character varying(64)', null: false
> column :state, 'smallint', null: false
> end
>
> class FooBar < Sequel::Model(:foo_bars)
> plugin :auto_validations
> plugin :defaults_setter
>
> default_values[:state] = 1
> end
>
> FooBar.create # => Sequel::ValidationFailed: state is not present
>
> With validation_helpers plugin I have no issues and everything works as 
> expected...
>

-- 
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/7c348600-2185-4619-b15d-752a7feff5f4%40googlegroups.com.

Reply via email to