Skip to content

Commit a1384e1

Browse files
author
Hilda Stastna
committed
Refactor get_rec_cls, add default record_class in the CiProcessing
1 parent 475c87e commit a1384e1

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

app/controllers/application_controller/ci_processing.rb

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -247,29 +247,12 @@ def cloud_object_store_button_operation(klass, task)
247247
process_objects(items.ids.sort, method, display_name)
248248
end
249249

250+
def record_class
251+
VmOrTemplate
252+
end
253+
250254
def get_rec_cls
251-
# FIXME: the specs for ci_processing rely on setting (and testing) request.parameters['controller'].
252-
# That is wrong and needs to be fixed.
253-
case request.parameters["controller"] || controller_name
254-
when "miq_template"
255-
MiqTemplate
256-
when "orchestration_stack"
257-
params[:display] == "instances" ? VmOrTemplate : OrchestrationStack
258-
when "service"
259-
Service
260-
when "cloud_object_store_container"
261-
params[:pressed].starts_with?("cloud_object_store_object") ? CloudObjectStoreObject : CloudObjectStoreContainer
262-
when "cloud_object_store_object"
263-
CloudObjectStoreObject
264-
when "ems_storage"
265-
params[:pressed].starts_with?("cloud_object_store_object") ? CloudObjectStoreObject : CloudObjectStoreContainer
266-
when "ems_cluster"
267-
%w[all_vms vms].include?(params[:display]) || params[:pressed].starts_with?('miq_template') ? VmOrTemplate : EmsCluster
268-
when "storage"
269-
%w[all_vms vms].include?(params[:display]) ? VmOrTemplate : Storage
270-
else
271-
VmOrTemplate
272-
end
255+
record_class
273256
end
274257

275258
def process_objects(objs, task, display_name = nil)

0 commit comments

Comments
 (0)