Module | Sequel::Plugins::DefaultsSetter
In: | lib/sequel/plugins/defaults_setter.rb

DefaultsSetter is a simple plugin that sets non-nil/NULL default values upon initialize:

      # column a default NULL
      # column b default 2
      album = Album.new.values # {:b => 2}
      album = Album.new(:a=>1, :b=>3).values # {:a => 1, :b => 3}

Usage:

      # Make all model subclass instances set defaults (called before loading subclasses)
      Sequel::Model.plugin :defaults_setter

      # Make the Album class set defaults
      Album.plugin :defaults_setter

### Methods

configure

### Classes and Modules

Module Sequel::Plugins::DefaultsSetter::ClassMethods
Module Sequel::Plugins::DefaultsSetter::InstanceMethods

### Public Class methods

configure(model)

Set the default values based on the model schema

[Source]

        # File lib/sequel/plugins/defaults_setter.rb, line 20
    20:       def self.configure(model)
    21:         model.send(:set_default_values)
    22:       end

[Validate]