Module: Sequel::Plugins::TypecastOnLoad::ClassMethods
- Defined in:
- lib/sequel/plugins/typecast_on_load.rb
Instance Attribute Summary collapse
-
#typecast_on_load_columns ⇒ Object
readonly
The columns to typecast on load for this model.
Instance Method Summary collapse
-
#add_typecast_on_load_columns(*columns) ⇒ Object
Add additional columns to typecast on load for this model.
-
#call(values) ⇒ Object
Typecast values using #load_typecast when the values are retrieved from the database.
Instance Attribute Details
#typecast_on_load_columns ⇒ Object (readonly)
The columns to typecast on load for this model.
32 33 34 |
# File 'lib/sequel/plugins/typecast_on_load.rb', line 32 def typecast_on_load_columns @typecast_on_load_columns end |
Instance Method Details
#add_typecast_on_load_columns(*columns) ⇒ Object
Add additional columns to typecast on load for this model.
35 36 37 |
# File 'lib/sequel/plugins/typecast_on_load.rb', line 35 def add_typecast_on_load_columns(*columns) @typecast_on_load_columns.concat(columns) end |
#call(values) ⇒ Object
Typecast values using #load_typecast when the values are retrieved from the database.
41 42 43 |
# File 'lib/sequel/plugins/typecast_on_load.rb', line 41 def call(values) super.load_typecast end |