detecting when a record is saved

If MySQL supports triggers, you could create a DB trigger to execute a
Ruby script upon an insertion.