# File lib/mongo_mapper/plugins/associations/belongs_to_association.rb, line 30 def add_touch_callbacks name = self.name method_name = "belongs_to_touch_after_save_or_destroy_for_#{name}" touch = options.fetch(:touch) @model.send(:define_method, method_name) do record = send(name) unless record.nil? if touch == true record.touch else record.touch(touch) end end end @model.after_save(method_name) @model.after_touch(method_name) @model.after_destroy(method_name) end