| Module | Sequel::Plugins::ClassTableInheritance::InstanceMethods |
| In: |
lib/sequel/plugins/class_table_inheritance.rb
|
Set the cti_key column to the name of the model.
# File lib/sequel/plugins/class_table_inheritance.rb, line 168
168: def before_create
169: return false if super == false
170: send("#{model.cti_key}=", model.name.to_s) if model.cti_key
171: end
Delete the row from all backing tables, starting from the most recent table and going through all superclasses.
# File lib/sequel/plugins/class_table_inheritance.rb, line 175
175: def delete
176: m = model
177: m.cti_tables.reverse.each do |table|
178: m.db.from(table).filter(m.primary_key=>pk).delete
179: end
180: self
181: end