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.
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/mongoid/relations/touchable.rb', line 53 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 |