From 166836ee55a2649644e6f0bd04bca58effe77b5a Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Tue, 21 Dec 2010 12:33:28 -0300 Subject: [PATCH] Reference all fields directly --- db/migrate/20101202205446_remove_published_articles.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20101202205446_remove_published_articles.rb b/db/migrate/20101202205446_remove_published_articles.rb index 1ab2534..a5cac79 100644 --- a/db/migrate/20101202205446_remove_published_articles.rb +++ b/db/migrate/20101202205446_remove_published_articles.rb @@ -3,7 +3,7 @@ class RemovePublishedArticles < ActiveRecord::Migration select_all("SELECT * from articles WHERE type = 'PublishedArticle'").each do |published| reference = Article.exists?(published['reference_article_id']) ? Article.find(published['reference_article_id']) : nil if reference - execute(ActiveRecord::Base.sanitize_sql(["UPDATE articles SET type = ?, abstract = ?, body = ? WHERE articles.id = ?", reference[:type], reference.abstract, reference.body, published['id']])) + execute(ActiveRecord::Base.sanitize_sql(["UPDATE articles SET type = ?, abstract = ?, body = ? WHERE articles.id = ?", reference[:type], reference[:abstract], reference[:body], published['id']])) else execute("DELETE from articles where articles.id = #{published['id']}") end -- libgit2 0.21.2