Skip to content

Commit

Permalink
define scope for stale dois
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Oct 21, 2018
1 parent 053c082 commit 4a58314
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4a58314

Please sign in to comment.