Sha256: 5d9fe431e78b930b3cdf253bfe003be026b0cc9904e6565e7acb87169c93e006
Contents?: true
Size: 451 Bytes
Versions: 7
Compression:
Stored size: 451 Bytes
Contents
module MongoMapper module Plugins module Touch extend ActiveSupport::Concern def touch(key = :updated_at) raise ArgumentError, "Invalid key named #{key}" unless self.key_names.include?(key.to_s) if self.class.embeddable? self.write_attribute(key, Time.now.utc) self._parent_document.touch else self.set(key => Time.now.utc) end true end end end end
Version data entries
7 entries across 7 versions & 3 rubygems