Sha256: 1b2290fbc83d47c01e7ed9ca7a08e98f83ad82152c9914e769ebf4f8612763e7
Contents?: true
Size: 590 Bytes
Versions: 38
Compression:
Stored size: 590 Bytes
Contents
module Noodall module GlobalUpdateTime class Stamp def self.read Rails.cache.read('global_update_time') if defined?(Rails) end def self.update! Rails.cache.write('global_update_time', Time.zone.now.utc) if defined?(Rails) end end def self.configure(model) model.class_eval do after_save :global_updated! after_destroy :global_updated! end end module InstanceMethods # Cache the updated time def global_updated! GlobalUpdateTime::Stamp.update! end end end end
Version data entries
38 entries across 38 versions & 1 rubygems