module Sequel::Plugins::DefaultsSetter::ClassMethods

  1. lib/sequel/plugins/defaults_setter.rb

Methods

Public Instance

  1. cache_default_values?
  2. default_values
  3. freeze

Attributes

default_values [R]

The default values to use for this model. A hash with column symbol keys and default values. If the default values respond to call, it will be called to get the value, otherwise the value will be used directly. You can manually modify this hash to set specific default values, by default the ones will be parsed from the database.

Public Instance methods

cache_default_values?()

Whether default values should be cached in the values hash after being retrieved.

[show source]
   # File lib/sequel/plugins/defaults_setter.rb
82 def cache_default_values?
83   @cache_default_values
84 end
freeze()

Freeze default values when freezing model class

[show source]
   # File lib/sequel/plugins/defaults_setter.rb
87 def freeze
88   @default_values.freeze
89   super
90 end