Module: Mongoid::Relations::Touchable::ClassMethods
- Defined in:
- lib/mongoid/relations/touchable.rb
Instance Method Summary collapse
-
#touchable(metadata) ⇒ Class
Add the metadata to the touchable relations if the touch option was provided.
Instance Method Details
#touchable(metadata) ⇒ Class
Add the metadata to the touchable relations if the touch option was provided.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/mongoid/relations/touchable.rb', line 20 def touchable() if .touchable? name = .name method_name = define_relation_touch_method(name) after_create method_name after_destroy method_name after_touch method_name end self end |