discourse/db/fixtures/001_refresh.rb
Josh Soref 59097b207f
DEV: Correct typos and spelling mistakes (#12812)
Over the years we accrued many spelling mistakes in the code base. 

This PR attempts to fix spelling mistakes and typos in all areas of the code that are extremely safe to change 

- comments
- test descriptions
- other low risk areas
2021-05-21 11:43:47 +10:00

25 lines
609 B
Ruby

# frozen_string_literal: true
class SeedData::Refresher
@mutex = Mutex.new
def self.refresh!
return if @refreshed
@mutex.synchronize do
return if @refreshed
# Fix any bust caches post initial migration
# Not that reset_column_information is not thread safe so we have to be careful
# 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
end
end
SeedData::Refresher.refresh!
SiteSetting.refresh!