Module | Sequel::Plugins::TypecastOnLoad::ClassMethods |
In: |
lib/sequel/plugins/typecast_on_load.rb
|
typecast_on_load_columns | [R] | The columns to typecast on load for this model. |
Call the setter method for each of the typecast on load columns, ensuring the model object will have the correct typecasting even if the database doesn‘t typecast the columns correctly.
# File lib/sequel/plugins/typecast_on_load.rb, line 48 48: def load(values) 49: o = super 50: typecast_on_load_columns.each do |c| 51: if v = values[c] 52: o.send("#{c}=", v) 53: end 54: end 55: o.changed_columns.clear 56: o 57: end