Mass downcase a field for all records in rails
You can simply go with
User.update_all('email = lower(email)')
The most efficient way would be to avoid using a Ruby iterator, and do it directly in SQL.
Inside of a normal migration file you can use this SQL for MySQL:
execute("UPDATE users SET email = LOWER(email)")