Module: Sequel::Plugins::SingleTableInheritance::InstanceMethods
- Defined in:
- lib/sequel/plugins/single_table_inheritance.rb
Instance Method Summary collapse
-
#before_create ⇒ Object
Set the sti_key column to the name of the model.
Instance Method Details
#before_create ⇒ Object
Set the sti_key column to the name of the model.
67 68 69 70 |
# File 'lib/sequel/plugins/single_table_inheritance.rb', line 67 def before_create return false if super == false send("#{model.sti_key}=", model.name.to_s) unless send(model.sti_key) end |