Nitpick, s/and/&&/ is preferable.  Also check `old_hash.present?` as one of the first conditions.