fixes #1092, fixes naming for tag alias|implication requests, includes fix method

This commit is contained in:
albert
2013-03-25 23:07:49 -04:00
parent b9e15e8a1f
commit fdb535ebbd
5 changed files with 31 additions and 8 deletions

13
script/fixes/010.rb Normal file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env ruby
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
ActiveRecord::Base.connection.execute("set statement_timeout = 0")
TagAlias.active.find_each do |tag_alias|
Tag.find_or_create_by_name(tag_alias.antecedent_name)
Tag.find_or_create_by_name(tag_alias.consequent_name)
if tag_alias.antecedent_tag.category != 0 && tag_alias.antecedent_tag.category != tag_alias.consequent_tag.category
tag_alias.consequent_tag.update_attribute(:category, tag_alias.antecedent_tag.category)
end
end