Sha256: d42d3906b0f1cf5b1f195a9da62880163b06aa800c5528f982b2866d239b9436
Contents?: true
Size: 596 Bytes
Versions: 6
Compression:
Stored size: 596 Bytes
Contents
module EasySeeds class Destroy ###For manually destroying tables, useful for if you have many joins tables. def self.destroy_table(class_name, table_string) puts "Destroying the #{table_string} table" class_name.destroy_all ApplicationRecord.connection.reset_pk_sequence!(table_string) end ###Used in conjunction to destroy all of your tables def self.destroy_tables(class_names, table_strings) (class_names.length - 1).downto(0) {|i| Destroy.destroy_table(class_names[i], table_strings[i])} end end end
Version data entries
6 entries across 6 versions & 1 rubygems