Class/Module Index [+]

Quicksearch

Sequel::Plugins::TypecastOnLoad::ClassMethods

Attributes

typecast_on_load_columns[R]

The columns to typecast on load for this model.

Public Instance Methods

add_typecast_on_load_columns(*columns) click to toggle source

Add additional columns to typecast on load for this model.

# File lib/sequel/plugins/typecast_on_load.rb, line 35
def add_typecast_on_load_columns(*columns)
  @typecast_on_load_columns.concat(columns)
end
inherited(subclass) click to toggle source

Give the subclass a copy of the typecast on load columns.

# File lib/sequel/plugins/typecast_on_load.rb, line 40
def inherited(subclass)
  super
  subclass.instance_variable_set(:@typecast_on_load_columns, typecast_on_load_columns.dup)
end
load(values) click to toggle source

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
def load(values)
  super.load_typecast
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.