module Sequel::Plugins::TypecastOnLoad::ClassMethods

  1. lib/sequel/plugins/typecast_on_load.rb

Attributes

typecast_on_load_columns [R]

The columns to typecast on load for this model.

Public Instance methods

add_typecast_on_load_columns(*columns)

Add additional columns to typecast on load for this model.

[show source]
   # File lib/sequel/plugins/typecast_on_load.rb
37 def add_typecast_on_load_columns(*columns)
38   @typecast_on_load_columns.concat(columns)
39 end
call(values)

Typecast values using load_typecast when the values are retrieved from the database.

[show source]
   # File lib/sequel/plugins/typecast_on_load.rb
43 def call(values)
44   o = super.load_typecast
45   o.send(:_clear_changed_columns, :initialize)
46   o
47 end
freeze()

Freeze typecast on load columns when freezing model class.

[show source]
   # File lib/sequel/plugins/typecast_on_load.rb
50 def freeze
51   @typecast_on_load_columns.freeze
52 
53   super
54 end