diff --git a/app/controllers/admin/galleries_controller.rb b/app/controllers/admin/galleries_controller.rb index e340568..2211f36 100644 --- a/app/controllers/admin/galleries_controller.rb +++ b/app/controllers/admin/galleries_controller.rb @@ -41,6 +41,9 @@ class Admin::GalleriesController < OrbitAdminController end end variable = AlbumVariable.first + if variable.nil? + variable = AlbumVariable.new + end variable.finish = false variable.save! Thread.new do @@ -84,6 +87,9 @@ class Admin::GalleriesController < OrbitAdminController if notalive if !params['album_id'].to_s.empty? variable = AlbumVariable.first + if variable.nil? + variable = AlbumVariable.new + end variable.finish = false variable.save! choice_ids = params['album_id'].split(',') @@ -392,6 +398,9 @@ class Admin::GalleriesController < OrbitAdminController end def init_upload variable = AlbumVariable.first + if variable.nil? + variable = AlbumVariable.new + end variable.count = params['all_length'].to_i variable.finish = false variable.progress_percent = '0%'