Skip to content

Commit

Permalink
Merge pull request ManageIQ#18825 from Fryguy/dont_do_rubys_job
Browse files Browse the repository at this point in the history
Remove Job.get_job_class method
  • Loading branch information
agrare committed May 30, 2019
2 parents c95298f + da1b315 commit 8ecc9fe
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/models/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@ class Job < ApplicationRecord
DEFAULT_TIMEOUT = 300
DEFAULT_USERID = 'system'.freeze

def self.get_job_class(process_type)
return Object.const_get(process_type)
rescue NameError
raise "Cannot Find Job Class=<#{process_type}> because it is not defined"
end

def self.create_job(process_type, options = {})
klass = get_job_class(process_type)
klass = Object.const_get(process_type)
ar_options = options.dup.delete_if { |k, _v| !Job.column_names.include?(k.to_s) }
job = klass.new(ar_options)
job.options = options
Expand Down

0 comments on commit 8ecc9fe

Please sign in to comment.