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.
56 57 58 59 |
# File 'lib/sequel/plugins/single_table_inheritance.rb', line 56 def before_create return false if super == false send("#{model.sti_key}=", model.name.to_s) unless send(model.sti_key) end |