Skip to content

Commit bc53c91

Browse files
committed
RUBY-1021 initialize read preference with redacted options in FSBucket
1 parent 9406d16 commit bc53c91

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/mongo/grid/fs_bucket.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class FSBucket
5757
attr_reader :options
5858

5959
# Get client from the database.
60+
#
61+
# @since 2.1.0
6062
def_delegators :database,
6163
:client
6264

@@ -400,7 +402,7 @@ def upload_from_stream(filename, io, opts = {})
400402
# @since 2.1.0
401403
def read_preference
402404
@read_preference ||= @options[:read] ?
403-
ServerSelector.get(client.options.merge(@options[:read] || {})) :
405+
ServerSelector.get(Options::Redacted.new((@options[:read] || {}).merge(client.options))) :
404406
database.read_preference
405407
end
406408

0 commit comments

Comments
 (0)