Merge branch '8784-dir-listings'
[arvados.git] / services / api / lib / kind_and_etag.rb
index 89c01ef3a2e086fdd38f2de2923dc00f7324c4a3..faf3ab04dd855585fda6ff027184c047d0a63163 100644 (file)
@@ -1,3 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 module KindAndEtag
 
   def self.included(base)
@@ -14,7 +18,7 @@ module KindAndEtag
     self.class.kind
   end
 
-  def etag
-    Digest::MD5.hexdigest(self.inspect).to_i(16).to_s(36)
+  def etag attrs=nil
+    Digest::MD5.hexdigest((attrs || self.attributes).inspect).to_i(16).to_s(36)
   end
 end