Last active
March 27, 2018 11:43
-
-
Save pedrozath/a8022a9d33dfd1eb9aecc563689412ef 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
| TruckVisit.all.each do |tv| | |
| t = tv.in_reefer_temperature | |
| next if t.blank? | |
| # we set the temperature to float if first character is a digit | |
| # else we set it to nil | |
| tv.update_column(:in_reefer_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
I get this error:
LocalJumpError: unexpected returnon line 3 it should be
next if t.blank?