aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/imports_controller.rb
diff options
context:
space:
mode:
authorZog2018-03-07 07:50:02 +0100
committerZog2018-03-12 12:00:13 +0100
commitb810deb08cadd56caeb76eb81cff363458bb79a3 (patch)
tree6fd0c1bc383a9fa501666f6d86cee2ec06c573cd /app/controllers/imports_controller.rb
parent7b53b4c86d0469c21b54f4f974fbae5fc205ed0f (diff)
downloadchouette-core-b810deb08cadd56caeb76eb81cff363458bb79a3.tar.bz2
Refs #6133; Fix specs
Diffstat (limited to 'app/controllers/imports_controller.rb')
-rw-r--r--app/controllers/imports_controller.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb
index 7a999d657..3ebbeb665 100644
--- a/app/controllers/imports_controller.rb
+++ b/app/controllers/imports_controller.rb
@@ -3,7 +3,7 @@ class ImportsController < ChouetteController
include RansackDateFilter
before_action only: [:index] { set_date_time_params("started_at", DateTime) }
skip_before_action :authenticate_user!, only: [:download]
- defaults resource_class: Import, collection_name: 'imports', instance_name: 'import'
+ defaults resource_class: Import::Base, collection_name: 'imports', instance_name: 'import'
before_action :ransack_status_params, only: [:index]
respond_to :html
belongs_to :workbench
@@ -37,7 +37,7 @@ class ImportsController < ChouetteController
protected
def collection
- scope = parent.imports.where(type: "WorkbenchImport")
+ scope = parent.imports.where(type: "Import::Workbench")
scope = self.ransack_period_range(scope: scope, error_message: t('imports.filters.error_period_filter'), query: :where_started_at_in)
@@ -54,14 +54,14 @@ class ImportsController < ChouetteController
def ransack_status_params
if params[:q]
- return params[:q].delete(:status_eq_any) if params[:q][:status_eq_any].empty? || ( (Import.status.values & params[:q][:status_eq_any]).length >= 4 )
+ return params[:q].delete(:status_eq_any) if params[:q][:status_eq_any].empty? || ( (Import::Base.status.values & params[:q][:status_eq_any]).length >= 4 )
params[:q][:status_eq_any].push("new", "running") if params[:q][:status_eq_any].include?("pending")
params[:q][:status_eq_any].push("aborted", "canceled") if params[:q][:status_eq_any].include?("failed")
end
end
def build_resource
- @import ||= WorkbenchImport.new(*resource_params) do |import|
+ @import ||= Import::Workbench.new(*resource_params) do |import|
import.workbench = parent
import.creator = current_user.name
end