Ho aggiornato la mia versione di rails di una mia app alla 4.1.0. Durante l'aggiornamento ho aggiornato tutte le gemme di Gemfile, che ha aggiornato anche act-as-taggable su 3.1.1.Dopo l'aggiornamento alle guide 4.1, act-as-taggable-on non funziona
ma dopo l'aggiornamento, quando ho provato ad aggiungere tag sul rispettivo oggetto, non è riuscito con il seguente errore.
post = Post.last
post.tag_list = "development"
post.save
ERROR: column "taggings_count" does not exist
dettagli errore è qui:
SQL (0.9ms) UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) - 1 WHERE "tags"."id" = 3146
PG::UndefinedColumn: ERROR: column "taggings_count" does not exist
LINE 1: UPDATE "tags" SET "taggings_count" = COALESCE("taggings_coun...
^
: UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) - 1 WHERE "tags"."id" = 3146
(0.3ms) ROLLBACK
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR: column "taggings_count" does not exist
LINE 1: UPDATE "tags" SET "taggings_count" = COALESCE("taggings_coun...
^
: UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) - 1 WHERE "tags"."id" = 3146
Ho riscontrato un problema nella voce Duplica ... per la chiave 'index_tags_on_name': CREATE UNICO INDICE 'index_tags_on_name' ON' tags' ('name'). non so se c'è qualcosa da capire proprio qui – Ben
Nella prima migrazione che questo genera, rimuovi la prima riga creando index_tags_on_name (vorrei copiare/incollare, ma l'ho già rimosso). – soychicka