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 49 49: def load_typecast 50: model.typecast_on_load_columns.each do |c| 51: if v = values[c] 52: send("#{c}=", v) 53: end 54: end 55: changed_columns.clear 56: self 57: end
Typecast values using load_typecast when the values are retrieved from the database.
# File lib/sequel/plugins/typecast_on_load.rb, line 61 61: def set_values(values) 62: ret = super 63: load_typecast 64: ret 65: end