Class: Bongo::Article

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Slug, Mongoid::Timestamps::Updated
Defined in:
app/models/bongo/article.rb

Instance Method Summary collapse

Instance Method Details

#cache_versionObject

Mongoid (v7.0.8) doesn’t have a cache_version method on its document. This causes jira.mongodb.org/browse/MONGOID-4680 when trying to use Rails collection caching.



18
19
20
21
22
23
24
# File 'app/models/bongo/article.rb', line 18

def cache_version
  if respond_to?(:updated_at)
    updated_at.utc.to_s(:usec)
  else
    nil
  end
end