lib/mongo/operation/shared/executable.rb in mongo-2.15.0.alpha vs lib/mongo/operation/shared/executable.rb in mongo-2.15.0
- old
+ new
@@ -1,5 +1,8 @@
+# frozen_string_literal: true
+# encoding: utf-8
+
# Copyright (C) 2015-2020 MongoDB Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -68,13 +71,10 @@
# @param [ Mongo::Server::Connection ] connection The connection on which
# the operation is performed.
# @param [ Mongo::Operation::Context ] context The operation context.
def build_message(connection, context)
msg = message(connection)
- if (server_api = context.server_api) &&
- # Commands in a transaction do not allow API parameters.
- !(context.in_transaction? && !context.starting_transaction?)
- then
+ if server_api = context.server_api
msg = msg.maybe_add_server_api(server_api)
end
msg
end