Skip to content

Commit

Permalink
Merge pull request #116 from bmic-development/wth-arm-regex
Browse files Browse the repository at this point in the history
wth - (SPARC-Database) Script Needed to Replace Special Characters in…
  • Loading branch information
Stuart-Johnson committed Feb 23, 2017
2 parents 9532ffe + 0621e77 commit f18b767
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/tasks/replace_arm_name_special_characters.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace :data do
task replace_arm_name_special_characters: :environment do

regex = /[[\]][\[][\\]()*\/?:]/

Arm.all.each do |arm|
match = arm.name =~ regex
unless match.nil?
arm.update_attribute(:name, arm.name.gsub(regex, ' '))
end
end
end
end

0 comments on commit f18b767

Please sign in to comment.