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
60 def load_typecast
61   model.typecast_on_load_columns.each do |c|
62     if v = values[c]
63       set_column_value("#{c}=", v)
64     end
65   end
66   _changed_columns.clear
67   self
68 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
73 def _refresh_set_values(values)
74   ret = super
75   load_typecast
76   ret
77 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
81 def _save_set_values(values)
82   ret = super
83   load_typecast
84   ret
85 end