From 86eeba128ac2c5b9fcf13a990c2da2dd15a090b3 Mon Sep 17 00:00:00 2001 From: mlomnicki Date: Mon, 12 Oct 2009 22:28:22 +0200 Subject: [PATCH] fixed sql reader --- lib/postpolicy/plugins/datasource/sql.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/postpolicy/plugins/datasource/sql.rb b/lib/postpolicy/plugins/datasource/sql.rb index 9ee8f34..01105b1 100644 --- a/lib/postpolicy/plugins/datasource/sql.rb +++ b/lib/postpolicy/plugins/datasource/sql.rb @@ -12,8 +12,8 @@ def exists?( value ) connection do |conn| command = conn.create_command( @query ) reader = command.execute_reader - while reader.next - if reader.values[0] && item[0] == value + while reader.next! + if reader.values[0] && reader.values[0] == value result = true break end