Question

When I access my data for a particular model in a list context, the updated_at date hasn't changed, however, when I access the same record in a individual (show) context, the date does appear to be changed.

List Context

enter image description here

Show Context

enter image description here

I am using jbuilder for the JSON views. They look like this:

List Context (index.json.jbuilder)

json.array! @media_files do |json, media_file|
  json.(media_file, :id, :name, :description, :category_id, :mime, :media_file_type_id, :size, :shareable, :deleted, :keywords, :updated_at, :version)
  json.url signed_url(media_file.url)
  json.thumb_url signed_url(media_file.thumb_url)
end

Show Context (show.json.jbuilder)

json.(@media_file, :id, :name, :description, :category_id, :mime, :media_file_type_id, :size, :shareable, :deleted, :keywords, :updated_at, :version)
json.url signed_url(@media_file.url)
json.thumb_url signed_url(@media_file.thumb_url)

Any idea what might be causing that?

Was it helpful?

Solution

So I ended up just disabling caching in production. That's my temporary fix. I would love to hear some feedback as to a better way to fix this issue as this is really just a workaround.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top