From e3b74f50f4cba43f336999a0259741895187d6b7 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Tue, 21 Dec 2010 12:44:40 -0300 Subject: [PATCH] Use the proper method for selecting from the database --- 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 fd8fbb1..9b2d766 100644 --- a/db/migrate/20101202205446_remove_published_articles.rb +++ b/db/migrate/20101202205446_remove_published_articles.rb @@ -1,7 +1,7 @@ class RemovePublishedArticles < ActiveRecord::Migration def self.up select_all("SELECT * from articles WHERE type = 'PublishedArticle'").each do |published| - reference = select('select * from articles where id = %d' % published['reference_article_id']).first + reference = select_one('select * from articles where id = %d' % published['reference_article_id']) if reference execute(ActiveRecord::Base.sanitize_sql(["UPDATE articles SET type = ?, abstract = ?, body = ? WHERE articles.id = ?", reference['type'], reference['abstract'], reference['body'], published['id']])) else -- libgit2 0.21.2