minor: alias #read_primary? with #primary?
This commit is contained in:
parent
0d91faf6b1
commit
fab538ed5e
|
@ -470,6 +470,7 @@ module Mongo
|
|||
def read_primary?
|
||||
@read_primary
|
||||
end
|
||||
alias :primary? :read_primary?
|
||||
|
||||
# Close the connection to the database.
|
||||
def close
|
||||
|
|
|
@ -137,6 +137,7 @@ module Mongo
|
|||
def read_primary?
|
||||
!@read_pool || @read_pool.length.zero?
|
||||
end
|
||||
alias :primary? :read_primary?
|
||||
|
||||
# Close the connection to the database.
|
||||
def close
|
||||
|
|
|
@ -32,6 +32,7 @@ class ConnectTest < Test::Unit::TestCase
|
|||
[RS.host, RS.ports[2]], :name => RS.name)
|
||||
assert @conn.connected?
|
||||
assert @conn.read_primary?
|
||||
assert @conn.primary?
|
||||
|
||||
assert_equal RS.primary, @conn.primary
|
||||
assert_equal RS.secondaries.sort, @conn.secondaries.sort
|
||||
|
|
|
@ -18,6 +18,7 @@ class ReplicaSetQuerySecondariesTest < Test::Unit::TestCase
|
|||
|
||||
def test_read_primary
|
||||
assert !@conn.read_primary?
|
||||
assert !@conn.primary?
|
||||
end
|
||||
|
||||
def test_con
|
||||
|
|
Loading…
Reference in New Issue