Cleanup code
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
class ImportsController < ApplicationController
|
||||
disallow_account_scope only: %i[ new create ]
|
||||
|
||||
layout "public"
|
||||
|
||||
disallow_account_scope only: %i[ new create ]
|
||||
before_action :set_import, only: %i[ show ]
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
@@ -17,10 +18,13 @@ class ImportsController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
@import = Current.account.imports.find(params[:id])
|
||||
end
|
||||
|
||||
private
|
||||
def set_import
|
||||
@import = Current.account.imports.find(params[:id])
|
||||
end
|
||||
|
||||
def start_import(account)
|
||||
import = nil
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class Export < ApplicationRecord
|
||||
end
|
||||
rescue => e
|
||||
update!(status: :failed)
|
||||
raise
|
||||
raise e
|
||||
ensure
|
||||
zipfile&.close
|
||||
zipfile&.unlink
|
||||
|
||||
Reference in New Issue
Block a user