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 182 182: def before_create 183: send("#{model.cti_key}=", model.name.to_s) if model.cti_key 184: super 185: 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 189 189: def delete 190: m = model 191: m.cti_tables.reverse.each do |table| 192: m.db.from(table).filter(m.primary_key=>pk).delete 193: end 194: self 195: end