Ruby While Syntax Sql Update Query From Another Table