Sha256: d10de9c0e21ea260300c48d3d665af0b5ca5e4b12e8a7c15ff895b66eedd8c5b
Contents?: true
Size: 727 Bytes
Versions: 29
Compression:
Stored size: 727 Bytes
Contents
# encoding: utf-8 module Mongoid module Relations module Touchable extend ActiveSupport::Concern included do class_attribute :touchables self.touchables = [] end module ClassMethods # Add the metadata to the touchable relations if the touch option was # provided. # # @example Add the touchable. # Model.touchable(meta) # # @param [ Metadata ] metadata The relation metadata. # # @return [ Class ] The model class. # # @since 3.0.0 def touchable(metadata) self.touchables.push(metadata.name) if metadata.touchable? self end end end end end
Version data entries
29 entries across 29 versions & 2 rubygems