Thank you Jeremy.
I currently have this, which appears to work:
def etag
digest(_models.map(&:id).zip(_models.map(&:lock_version)).join)
end
def last_modified
_models.map(&:updated_at).max
end
private
def digest(string)
Digest::SHA1.hexdigest(string)
end
def _models
[
collection,
*collection.items,
*collection.resources,
*collection.resources.compact.map(&:original),
*collection.resources.map(&:original).compact.map(&:proxies)
].compact.uniq
end
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.