module Sequel::Plugins::PgAutoValidateEnums::InstanceMethods

  1. lib/sequel/plugins/pg_auto_validate_enums.rb

Methods

Public Instance

  1. validate

Public Instance methods

validate()

Validate that all of the model’s enum columns have valid values.

[show source]
   # File lib/sequel/plugins/pg_auto_validate_enums.rb
76 def validate
77   super
78 
79   klass = self.class
80   opts = klass.pg_auto_validate_enums_opts
81   klass.pg_auto_validate_enums_metadata.each do |column, values|
82     validates_includes(values, column, opts)
83   end
84 end