Module Sequel::Plugins::TypecastOnLoad::InstanceMethods
In: lib/sequel/plugins/typecast_on_load.rb

Methods

Public Instance methods

Call the setter method for each of the model‘s typecast_on_load_columns with the current value, so it can be typecasted correctly.

[Source]

    # File lib/sequel/plugins/typecast_on_load.rb, line 45
45:         def load_typecast
46:           model.typecast_on_load_columns.each do |c|
47:             if v = values[c]
48:               send("#{c}=", v)
49:             end
50:           end
51:           changed_columns.clear
52:           self
53:         end

Typecast values using load_typecast when the values are retrieved from the database.

[Source]

    # File lib/sequel/plugins/typecast_on_load.rb, line 57
57:         def set_values(values)
58:           ret = super
59:           load_typecast
60:           ret
61:         end

[Validate]