Ruby While Syntax Sql Update Query