| Module | Sequel::Plugins::TypecastOnLoad::InstanceMethods |
| In: |
lib/sequel/plugins/typecast_on_load.rb
|
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, 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.
# 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