Sha256: 1ca288097e8f5de4d868701f10bab377973bef82a8d8f3c3cc0120c3bd8f44c3
Contents?: true
Size: 450 Bytes
Versions: 12
Compression:
Stored size: 450 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
12 entries across 12 versions & 1 rubygems