Module: Mongoid::Relations::Touchable::ClassMethods

Defined in:
lib/mongoid/relations/touchable.rb

Instance Method Summary collapse

Instance Method Details

#touchable(metadata) ⇒ Class

Add the metadata to the touchable relations if the touch option was provided.

Examples:

Add the touchable.

Model.touchable(meta)

Parameters:

  • metadata (Metadata)

    The relation metadata.

Returns:

  • (Class)

    The model class.

Since:

  • 3.0.0



25
26
27
28
# File 'lib/mongoid/relations/touchable.rb', line 25

def touchable()
  self.touchables.push(.name) if .touchable?
  self
end