I’m in the console and I have a model called line with a fontsize field.
I want to normalise my font sizes so that fonts between 20-25 are set to 24 and any above are set to 28 and any fonts in the 30s is set to 32.
How do I go about mass updating my database from the console like this?
(I’m reading this as something you only want to do once, so I’ve gone for readability over performance or brevity)
Assuming Rails >3 and that your model is called
Line(with a capital “L”), the following should do you: