Skip to content
Extraits de code Groupes Projets
Valider 20d40b74 rédigé par Raphael Sofaer's avatar Raphael Sofaer
Parcourir les fichiers

fix execute command in migration

parent c256533a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
class DowncaseTags < ActiveRecord::Migration
def self.consolidate_tags_with_name(name)
tags = execute("SELECT * FROM tags WHERE tags.name = ?;", name)
tags = execute("SELECT * FROM tags WHERE tags.name = #{name};")
keep_tag = tags.pop
tags.each do |bad_tag|
execute("UPDATE taggings
SET taggings.tag_id = #{keep_tag.first}
WHERE taggings.tag_id = #{bad_tag.first};")
execute("DELETE tags WHERE tags.id = #{bad_tag.first}")
execute("DELETE tags WHERE tags.id = #{bad_tag.first};")
end
end
def self.up
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter