Merge branch 'master' into 4383-easy-install
[arvados.git] / services / api / app / models / collection.rb
index 84101ffdd44424363ed91bfb4d42bf97a1c09bd6..accd2cc62c7bc049518481efdcbf49db592f325a 100644 (file)
@@ -10,6 +10,9 @@ class Collection < ArvadosModel
   before_validation :set_portable_data_hash
   validate :ensure_hash_matches_manifest_text
 
+  # Query only undeleted collections by default.
+  default_scope where("expires_at IS NULL or expires_at > CURRENT_TIMESTAMP")
+
   api_accessible :user, extend: :common do |t|
     t.add :name
     t.add :description