lib/nazrin/document_client.rb in nazrin-2.3.0 vs lib/nazrin/document_client.rb in nazrin-2.4.0

- old
+ new

@@ -1,14 +1,15 @@ module Nazrin class DocumentClient attr_reader :client - def initialize + def initialize(config=Nazrin.config) @client = Aws::CloudSearchDomain::Client.new( - endpoint: Nazrin.config.document_endpoint, - region: Nazrin.config.region, - access_key_id: Nazrin.config.access_key_id, - secret_access_key: Nazrin.config.secret_access_key) + endpoint: config.document_endpoint, + region: config.region, + access_key_id: config.access_key_id, + secret_access_key: config.secret_access_key, + logger: config.logger) end def add_document(id, field_data) ActiveSupport::Deprecation.warn 'config.debug_mode is deprecated. Use config.mode = \'sandbox\' instead.' and return nil if Nazrin.config.debug_mode return nil if Nazrin.config.mode == 'sandbox'