From 4a583140a8166875b75e31ba157c907ee5979828 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sun, 21 Oct 2018 19:31:11 +0200 Subject: [PATCH] define scope for stale dois --- app/models/doi.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/doi.rb b/app/models/doi.rb index 5df418da3..dcab58e08 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -88,6 +88,7 @@ class Doi < ActiveRecord::Base before_create { self.created = Time.zone.now.utc.iso8601 } scope :q, ->(query) { where("dataset.doi = ?", query) } + scope :not_indexed, -> { where("updated > indexed") } # use different index for testing index_name Rails.env.test? ? "dois-test" : "dois"