The horror.
I had to make a minor change in the code and add a little procedure to make it work. Here’s the modified code:
users=User.where("name like '%@%'")
Then the rails console starts “more-ing” you through the user data so i needed to q out of that. Then:
users.each do |user|
user.name.gsub!(/@(.*)/,"")
puts "New name: #{user.name}"
# user.save
end
Then the rails console showed me the list of new names (correct!), and then put me back into a “more” of the users. q again.
Then:
users.each do |user|
user.name.gsub!(/@(.*)/,"")
puts "New name: #{user.name}"
user.save
end
…and no more email address user names and everything looking good on the forum front end.
Thanks again @pfaffman for your generous help.