Last active
August 29, 2015 14:08
-
-
Save goooooouwa/88225d9ef15b353d3d6f to your computer and use it in GitHub Desktop.
remove trailing whitespaces. works for strings like "Window Furnishings " and "Bollards ".
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
| ConstrBase::Trade.find_each do |trade| | |
| if matches = /^((\S+\s+)+(\S*))\s*$/.match(trade.name) | |
| trade.name = matches[1] | |
| trade.save | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment