module Sequel::Plugins::SingleTableInheritance::InstanceMethods

  1. lib/sequel/plugins/single_table_inheritance.rb

Methods

Public Instance

  1. before_create

Public Instance methods

before_create ()

Set the sti_key column based on the sti_key_map.

[show source]
# File lib/sequel/plugins/single_table_inheritance.rb, line 210
def before_create
  send("#{model.sti_key}=", model.sti_key_chooser.call(self)) unless self[model.sti_key]
  super
end