Module: Sequel::Plugins::SingleTableInheritance::InstanceMethods

Defined in:
lib/sequel/plugins/single_table_inheritance.rb

Instance Method Summary collapse

Instance Method Details

#before_createObject

Set the sti_key column based on the sti_key_map.



161
162
163
164
# File 'lib/sequel/plugins/single_table_inheritance.rb', line 161

def before_create
  send("#{model.sti_key}=", model.sti_key_map[model]) unless self[model.sti_key]
  super
end