Class Index [+]

Quicksearch

Sequel::Plugins::DefaultsSetter::ClassMethods

Attributes

default_values[R]

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.

Public Instance Methods

set_dataset(*) click to toggle source

Set the default values when loading the dataset.

    # File lib/sequel/plugins/defaults_setter.rb, line 32
32:         def set_dataset(*)
33:           x = super
34:           set_default_values
35:           x
36:         end

Private Instance Methods

set_default_values() click to toggle source
    # File lib/sequel/plugins/defaults_setter.rb, line 40
40:         def set_default_values
41:           h = {}
42:           @db_schema.each{|k, v| h[k] = v[:ruby_default] if v[:ruby_default]} if @db_schema
43:           @default_values = h
44:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.