Module Sequel::Plugins::SingleTableInheritance::InstanceMethods
In: lib/sequel/plugins/single_table_inheritance.rb

Methods

Public Instance methods

Set the sti_key column based on the sti_key_map.

[Source]

     # File lib/sequel/plugins/single_table_inheritance.rb, line 247
247:         def before_validation
248:           if new? && model.sti_key && !self[model.sti_key]
249:             set_column_value("#{model.sti_key}=", model.sti_key_chooser.call(self))
250:           end
251:           super
252:         end

[Validate]