2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-06-17 16:15:43 +08:00
|
|
|
class SeedData::Refresher
|
|
|
|
def self.refresh!
|
|
|
|
return if @refreshed
|
|
|
|
|
|
|
|
# Fix any bust caches post initial migration
|
|
|
|
# Not that reset_column_information is not thread safe so we have to becareful
|
|
|
|
# not to run it concurrently within the same process.
|
|
|
|
ActiveRecord::Base.connection.tables.each do |table|
|
|
|
|
table.classify.constantize.reset_column_information rescue nil
|
|
|
|
end
|
|
|
|
|
|
|
|
@refreshed = true
|
|
|
|
end
|
2020-06-17 13:23:45 +08:00
|
|
|
end
|
|
|
|
|
2020-06-17 16:15:43 +08:00
|
|
|
SeedData::Refresher.refresh!
|
2019-03-19 04:09:13 +08:00
|
|
|
SiteSetting.refresh!
|