mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
For heroku, check if necessary table exist before trying to precompile assets
This commit is contained in:
parent
efc70a2bca
commit
17f0777d14
1 changed files with 7 additions and 3 deletions
|
@ -48,9 +48,13 @@ end
|
|||
|
||||
task 'assets:precompile:css' => 'environment' do
|
||||
RailsMultisite::ConnectionManagement.each_connection do |db|
|
||||
puts "Compiling css for #{db}"
|
||||
[:desktop, :mobile].each do |target|
|
||||
puts DiscourseStylesheets.compile(target, force: true)
|
||||
# Heroku precompiles assets before db migration, so tables may not exist.
|
||||
# css will get precompiled during first request instead in that case.
|
||||
if ActiveRecord::Base.connection.table_exists?(ColorScheme.table_name)
|
||||
puts "Compiling css for #{db}"
|
||||
[:desktop, :mobile].each do |target|
|
||||
puts DiscourseStylesheets.compile(target, force: true)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue