Topic: rails console not responding after iterating on objects from database


I'm having a basic problem with rails console that I am hoping someone can help with. I am trying to do a batch update of objects of a type User for database maintenance. I am trying to run code like this:

User.all.each do |i|
     if (i.registered == "not yet registered")
           i.registered = "not_yet_registered"

When I paste this into the terminal and hit enter, it flashes the question "Display all 446 possibilities? (y or n)" No matter what I select it doesn't output anything or make the updates and then rails console becomes unresponsive and I have to close the window to restart it (typing quit doesn't work). User.all.each { |i| puts } works as expected so I think it must be something either to do with the condition or the save method, but i can't figure what it would be. Could someone explain what's going on?


Last edited by KiwiCali (2011-06-26 04:06:50)