Model.all.each do |x|
if conditional expression
x.stage=1
x.save
end
end
It's the same script as above. When enabled
irb(main):004:2>
Display all 746 possibilities? (y or n)
!
!=
!~
<=>
==
===
=~
After performing the conditional expression, the script malfunctions with the above strange functionality.
Is there any way to give me an option on the console so that I don't get a Yes/No?
ruby-on-rails console
It's a self-answer.
The cause was a problem caused by two tabs of indent in the script. If you double-click a tab on the terminal, functions like AutoComplete are executed, and the two tabs on the indent must have made the same behavior. All indentations are removed, so they work fine.
There's a reason why indentation is not a tab but a space.
© 2024 OneMinuteCode. All rights reserved.