From 7b5a73a2d2a2a9f0fe7df6be1e010e11c7952a77 Mon Sep 17 00:00:00 2001 From: albert Date: Mon, 18 Mar 2013 09:33:45 -0700 Subject: [PATCH] fixes #931 --- app/models/note.rb | 2 +- script/fixes/006.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/note.rb b/app/models/note.rb index 8290cb36d..d61865e9a 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -39,7 +39,7 @@ class Note < ActiveRecord::Base end if params[:post_id].present? - q = q.body_matches(params[:post_id]) + q = q.where("post_id = ?", params[:post_id].to_i) end if params[:post_tags_match].present? diff --git a/script/fixes/006.rb b/script/fixes/006.rb index 1630c819d..978fa3467 100644 --- a/script/fixes/006.rb +++ b/script/fixes/006.rb @@ -15,7 +15,7 @@ Post.where("created_at > '2013-02-01'").find_each do |post| post.update_column(:tag_count_character, post.tag_count_character) end -PoolVersion.where("post_ids like '% 0 %'").find_each do |pool_version| +PoolVersion.where("post_ids like '% 1 %'").find_each do |pool_version| cleaned_post_ids = pool_version.post_ids.scan(/(\d+) \d+/).join(" ") pool_version.update_column(:post_ids, cleaned_post_ids) end