From ba288a0f4b0585e2cf9da6849eb513467b8a76a5 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Thu, 1 Apr 2010 13:38:35 +0200 Subject: [PATCH] Lesser Ruby-warnings: warning: instance variable @txn not initialized --- lib/sbdb/db.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sbdb/db.rb b/lib/sbdb/db.rb index f840925..fa82405 100644 --- a/lib/sbdb/db.rb +++ b/lib/sbdb/db.rb @@ -78,7 +78,8 @@ module SBDB @home, @db = opts[:env], opts[:env] ? opts[:env].bdb_object.db : Bdb::Db.new opts[:type] = TYPES.index(self.class) || UNKNOWN @db.re_len = opts[:re_len] if opts[:re_len] - @txn, txn = nil, opts[:txn] # First is the global txn, second only for open. + @txn = nil + txn = opts[:txn] # First is the global txn, second only for open. begin @db.open txn && txn.bdb_object, file, opts[:name], opts[:type], opts[:flags] || 0, opts[:mode] || 0 rescue Object