Sha256: c8c796dfd6ff3422b2519e3572a337a5cd02479af6f0f8876b75208f8d0a1736

Contents?: true

Size: 727 Bytes

Versions: 37

Compression:

Stored size: 727 Bytes

Contents

module PactBroker
  module Pacts
    module PactPublicationCleanSelectorDatasetModule
      # we've already done the latest_by_consumer_tag in the clean
      def latest_by_consumer_tag_for_clean_selector(selector)
        query = latest_by_consumer_tag
        query = query.for_consumer_name(selector.pacticipant_name) if selector.pacticipant_name
        query = query.for_consumer_version_tag(selector.tag) if selector.tag && selector.tag.is_a?(String)
        query = query.where_age_less_than(selector.max_age) if selector.max_age
        query
      end

      def where_age_less_than(days)
        start_date = Date.today - days
        where{ pact_publications[:created_at] >= start_date }
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
pact_broker-2.112.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.111.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.109.1 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.109.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.108.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.107.1 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.107.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.107.0.beta.1 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.106.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.105.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.104.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.103.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.102.2 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.102.1 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.102.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.101.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.100.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.99.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.98.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb
pact_broker-2.97.0 lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb