From 828420d447214fa51bf6de72a6b333316016bb74 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Thu, 28 Oct 2021 07:05:53 +1100 Subject: [PATCH] fix(clean): honour max_age when set in clean selector --- lib/pact_broker/db/clean/selector.rb | 2 +- lib/pact_broker/tasks/clean_task.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pact_broker/db/clean/selector.rb b/lib/pact_broker/db/clean/selector.rb index a011a3f0f..0be400a3a 100644 --- a/lib/pact_broker/db/clean/selector.rb +++ b/lib/pact_broker/db/clean/selector.rb @@ -33,7 +33,7 @@ def to_hash end alias_method :to_h, :to_hash - def to_json + def to_json(opts = nil) (@source_hash || to_hash).to_json end diff --git a/lib/pact_broker/tasks/clean_task.rb b/lib/pact_broker/tasks/clean_task.rb index 231ef4927..f70e3edc0 100644 --- a/lib/pact_broker/tasks/clean_task.rb +++ b/lib/pact_broker/tasks/clean_task.rb @@ -17,9 +17,9 @@ def initialize &block end def keep_version_selectors=(keep_version_selectors) - require "pact_broker/matrix/unresolved_selector" + require "pact_broker/db/clean/selector" @keep_version_selectors = [*keep_version_selectors].collect do | hash | - PactBroker::Matrix::UnresolvedSelector.from_hash(hash) + PactBroker::DB::Clean::Selector.from_hash(hash) end end