Created
March 20, 2018 14:21
-
-
Save pedrozath/a5353156b7f1bf8a0c34cfcfd84de2df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BookingContainer.all.each do |b| | |
| t = b.temperature | |
| next if t.blank? | |
| # We set the temperature to float if first character is a digit | |
| # else we set it to nil | |
| b.update_column(:temperature, (t[0] =~ /\d/ ? t.to_f : nil)) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment