Sha256: 61ebec606cf17234347e152b949b27ad85e4de4209b58eb7bdd20c43761e925e

Contents?: true

Size: 396 Bytes

Versions: 10

Compression:

Stored size: 396 Bytes

Contents

# frozen_string_literal: true
module Shipit
  module Api
    module Cacheable
      def render_resources(resources, *)
        super if stale?(etag: resources, last_modified: resources.map(&:updated_at).max, template: false)
      end

      def render_resource(resource, *)
        super if stale?(etag: resource, last_modified: resource.updated_at, template: false)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
shipit-engine-0.39.0 app/controllers/concerns/shipit/api/cacheable.rb
shipit-engine-0.38.0 app/controllers/concerns/shipit/api/cacheable.rb
shipit-engine-0.37.0 app/controllers/concerns/shipit/api/cacheable.rb
shipit-engine-0.36.1 app/controllers/concerns/shipit/api/cacheable.rb
shipit-engine-0.36.0 app/controllers/concerns/shipit/api/cacheable.rb
shipit-engine-0.35.1 app/controllers/concerns/shipit/api/cacheable.rb
shipit-engine-0.35.0 app/controllers/concerns/shipit/api/cacheable.rb
shipit-engine-0.34.0 app/controllers/concerns/shipit/api/cacheable.rb
shipit-engine-0.33.0 app/controllers/concerns/shipit/api/cacheable.rb
shipit-engine-0.32.0 app/controllers/concerns/shipit/api/cacheable.rb