module Sequel::Plugins::TypecastOnLoad::InstanceMethods

Public Instance Methods

load_typecast() click to toggle source

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

   # File lib/sequel/plugins/typecast_on_load.rb
62 def load_typecast
63   model.typecast_on_load_columns.each do |c|
64     if v = values[c]
65       set_column_value("#{c}=", v)
66     end
67   end
68   self
69 end

Private Instance Methods

_refresh_set_values(values) click to toggle source

Typecast values using load_typecast when the values are refreshed manually.

Calls superclass method
   # File lib/sequel/plugins/typecast_on_load.rb
74 def _refresh_set_values(values)
75   ret = super
76   load_typecast
77   ret
78 end
_save_set_values(values) click to toggle source

Typecast values using load_typecast when the values are refreshed automatically after a save.

Calls superclass method
   # File lib/sequel/plugins/typecast_on_load.rb
82 def _save_set_values(values)
83   ret = super
84   load_typecast
85   ret
86 end