Report question

Question: how does activerecord know to perform an insert or update?