Sha256: db3d57e7610e89f809cbbd3895b3c2e9bfab2dc55e73c9185599e25f1b281f9d
Contents?: true
Size: 628 Bytes
Versions: 3
Compression:
Stored size: 628 Bytes
Contents
module ActiveModelSerializers class Model module Caching extend ActiveSupport::Concern included do attr_writer :updated_at attributes :id end # Defaults to the downcased model name and updated_at def cache_key ActiveSupport::Cache.expand_cache_key([ self.class.model_name.name.downcase, "#{id}-#{updated_at.strftime('%Y%m%d%H%M%S%9N')}" ].compact) end # Defaults to the time the serializer file was modified. def updated_at defined?(@updated_at) ? @updated_at : File.mtime(__FILE__) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems