Files
danbooru/script/fixes/019_fix_pool_names.rb
Toks 4b6edbb50d #1984: Update script
A pool version should be created to keep track of the change.
2013-09-26 20:50:40 -04:00

11 lines
328 B
Ruby

#!/usr/bin/env ruby
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
ActiveRecord::Base.connection.execute("set statement_timeout = 0")
Pool.where("name like ?", "%,%").find_each do |pool|
pool.update_attribute(:name, pool.name.gsub(/,/, ""))
pool.create_version(true)
end