Fix bug.
This commit is contained in:
parent
750b371737
commit
2f5229cdb6
|
@ -6,6 +6,7 @@ class Admin::GalleriesController < OrbitAdminController
|
||||||
before_action :log_user_action
|
before_action :log_user_action
|
||||||
layout :compute_layout
|
layout :compute_layout
|
||||||
find_tag = Tag.all.select{|value| value.name==I18n.t('gallery.not_show_desc')}
|
find_tag = Tag.all.select{|value| value.name==I18n.t('gallery.not_show_desc')}
|
||||||
|
RackTempMiddleExist = defined?(Rack::TempfileReaper)
|
||||||
if find_tag.length==0
|
if find_tag.length==0
|
||||||
module_app_id = ModuleApp.where(:key=>"gallery").first[:_id]
|
module_app_id = ModuleApp.where(:key=>"gallery").first[:_id]
|
||||||
tags = ModuleApp.where(:key=>"gallery").first.tags
|
tags = ModuleApp.where(:key=>"gallery").first.tags
|
||||||
|
@ -563,7 +564,7 @@ class Admin::GalleriesController < OrbitAdminController
|
||||||
album_unprocess.save_var = file
|
album_unprocess.save_var = file
|
||||||
album_unprocess.save!
|
album_unprocess.save!
|
||||||
ObjectSpace.undefine_finalizer(file.tempfile)
|
ObjectSpace.undefine_finalizer(file.tempfile)
|
||||||
request.set_header(Rack::RACK_TEMPFILES, []) # Avoid Rack::TempfileReaper Middleware to unlink temp files automatically.
|
request.set_header(Rack::RACK_TEMPFILES, []) if RackTempMiddleExist # Avoid Rack::TempfileReaper Middleware to unlink temp files automatically.
|
||||||
end
|
end
|
||||||
image.save!
|
image.save!
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue