code: def _set_timestamps_on_attach(self, record, exists=False):
          
          fresh = self._parent.fresh_timestamp()
  
          if not exists and self._has_pivot_column(self.created_at()):
              record[self.created_at()] = fresh
  
          if self._has_pivot_column(self.updated_at()):
              record[self.updated_at()] = fresh
  
          return record
docs: Set the creation an update timestamps on an attach record.