Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Work around BC break in Ruby mongo driver v1.8.4
Browse files Browse the repository at this point in the history
Fixes #100
  • Loading branch information
bobthecow committed Apr 20, 2013
1 parent 31bc897 commit 9387c71
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## v2.3.4

* [Fix #100][i100] — Work around backwards compatibility break in `mongo` gem 1.8.4 (Ruby backend).

[i100]: https://github.com/bobthecow/genghis/issues/100


## v2.3.3

* [Fix #105][i105] — Fix bug introduced when rendering DB references.
Expand Down
4 changes: 2 additions & 2 deletions genghis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,13 @@ def initialize(dsn)
# name this server something useful
name = uri.host

if user = uri.auths.map { |a| a['username'] }.first
if user = uri.auths.map { |a| a[:username] || a['username'] }.first
name = "#{user}@#{name}"
end

name = "#{name}:#{uri.port}" unless uri.port == 27017

if db = uri.auths.map { |a| a['db_name'] }.first
if db = uri.auths.map { |a| a[:db_name] || a['db_name'] }.first
unless db == 'admin'
name = "#{name}/#{db}"
@db = db
Expand Down
4 changes: 2 additions & 2 deletions src/rb/genghis/models/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ def initialize(dsn)
# name this server something useful
name = uri.host

if user = uri.auths.map { |a| a['username'] }.first
if user = uri.auths.map { |a| a[:username] || a['username'] }.first
name = "#{user}@#{name}"
end

name = "#{name}:#{uri.port}" unless uri.port == 27017

if db = uri.auths.map { |a| a['db_name'] }.first
if db = uri.auths.map { |a| a[:db_name] || a['db_name'] }.first
unless db == 'admin'
name = "#{name}/#{db}"
@db = db
Expand Down

0 comments on commit 9387c71

Please sign in to comment.