Class: PactBroker::DB::ValidateEncoding

Inherits:
Object
  • Object
show all
Extended by:
Messages
Defined in:
lib/pact_broker/db/validate_encoding.rb

Class Method Summary collapse

Methods included from Messages

message, pluralize, validation_message, validation_message_at_index

Class Method Details

.call(connection) ⇒ Object



10
11
12
13
14
15
# File 'lib/pact_broker/db/validate_encoding.rb', line 10

def self.call connection
  encoding = connection.opts[:encoding] || connection.opts["encoding"]
  unless encoding =~ /utf\-?8/i
    raise ConnectionConfigurationError.new(message("errors.validation.connection_encoding_not_utf8", encoding: encoding.inspect))
  end
end