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

Defined in:
lib/sequel/plugins/defaults_setter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#default_valuesObject (readonly)

The default values to set in initialize 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.



45
46
47
# File 'lib/sequel/plugins/defaults_setter.rb', line 45

def default_values
  @default_values
end

Instance Method Details

#freezeObject

Freeze default values when freezing model class



52
53
54
55
# File 'lib/sequel/plugins/defaults_setter.rb', line 52

def freeze
  @default_values.freeze
  super
end