diff --git a/app/lib/three_scale/jobs.rb b/app/lib/three_scale/jobs.rb index a3507ee3f3..1a2b082db6 100644 --- a/app/lib/three_scale/jobs.rb +++ b/app/lib/three_scale/jobs.rb @@ -7,8 +7,6 @@ module ThreeScale module Jobs class Task - attr_reader :object - def initialize(object, method, *args) @object = object @method = method @@ -45,8 +43,7 @@ def map(tasks) def deserialize(args) hash = normalize_task_args(args) - permitted_classes = ActiveRecord::Base.yaml_column_permitted_classes + ThreeScale::Jobs::JOB_CLASSES - klass, method, arguments = YAML.load(hash[:init_args], permitted_classes: permitted_classes) + klass, method, arguments = YAML.unsafe_load(hash[:init_args]) hash[:klass].constantize.new(klass, method, *arguments) end @@ -133,9 +130,5 @@ def run HOUR = Task.map([ [Rails, :env] ]).freeze # just a fake job to ensure cron works - - PERIODS = [HOUR, DAILY, WEEK, MONTH, BILLING] - - JOB_CLASSES = ThreeScale::Jobs::PERIODS.flatten.map(&:object) end end diff --git a/test/unit/three_scale/middleware/cors_test.rb b/test/unit/three_scale/middleware/cors_test.rb index 36c07b4e75..a620ae1093 100644 --- a/test/unit/three_scale/middleware/cors_test.rb +++ b/test/unit/three_scale/middleware/cors_test.rb @@ -76,7 +76,7 @@ class ThreeScale::Middleware::CorsTest < ActiveSupport::TestCase end test 'provider signup path excluded in default configs' do - cors_config = YAML.load_file(Rails.root.join("config/cors.yml"), aliases: true, permitted_classes: [Symbol, Regexp]).deep_symbolize_keys + cors_config = YAML.unsafe_load_file(Rails.root.join("config/cors.yml")).deep_symbolize_keys rails_envs = %i[development test production] rails_envs.each do |rails_env| stub_config = cors_config[rails_env]