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
76 def cache_default_values?
77   @cache_default_values
78 end
freeze()

Freeze default values when freezing model class

[show source]
   # File lib/sequel/plugins/defaults_setter.rb
81 def freeze
82   @default_values.freeze
83   super
84 end