We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e39f8ae commit ac4ac33Copy full SHA for ac4ac33
app/lib/seeds.rb
@@ -20,10 +20,9 @@ def perform
20
def flushdb
21
raise 'Not in production!' if production?
22
23
- load_all_models!
24
-
25
- ActiveRecord::Base.connection.transaction do
26
- ApplicationRecord.descendants.each(&:delete_all)
+ ActiveRecord::Base.connection.tables.each do |table|
+ next if table == 'schema_migrations'
+ ActiveRecord::Base.connection.execute("TRUNCATE TABLE #{table} CASCADE;")
27
end
28
29
0 commit comments