Fix bug.
This commit is contained in:
parent
c3cfada5d7
commit
bf6234cdbc
|
@ -1,6 +1,7 @@
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
get 'ad_banners/widget'
|
get 'ad_banners/widget'
|
||||||
|
if ENV['worker_num']=='0' && File.basename($0) != 'rake' && !Rails.const_defined?('Console')
|
||||||
Thread.new do
|
Thread.new do
|
||||||
ad_images = AdImage.where(:video_file.ne=>nil,:video_snapshot=>nil).to_a
|
ad_images = AdImage.where(:video_file.ne=>nil,:video_snapshot=>nil).to_a
|
||||||
ad_images.each do |ad_image|
|
ad_images.each do |ad_image|
|
||||||
|
@ -10,6 +11,7 @@ Thread.new do
|
||||||
ad_image.save
|
ad_image.save
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
locales = Site.find_by(site_active: true).in_use_locales rescue I18n.available_locales
|
locales = Site.find_by(site_active: true).in_use_locales rescue I18n.available_locales
|
||||||
|
|
||||||
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
|
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
|
||||||
|
|
Loading…
Reference in New Issue