app/models/es_cached_record.rb
def not_expired?
    expired = false

    # If last fetch time isn't blank
    unless last_es_fetched_at.blank?
      expired = true if last_es_fetched_at.between?(DateTime.now - 4.hours)
    end
    return expired
  end
## Determines whether a cached record has expired data or not
Determines whether a cached record has expired data or not
Determines whether a cached record has expired data or not
def not_expired?
    expired = false
    unless last_es_fetched_at.blank?
      expired = true if last_es_fetched_at.between?(DateTime.now - 4.hours)
    end
    return expired
  end
def not_expired? expired = false unless last_es_fetched_at . blank? expired = true if last_es_fetched_at . between? ( DateTime . now - 4 . hours ) end return expired end
Determines whether a cached record has expired data or not
Determines whether a cached record has expired data or not
# If last fetch time isn't blank