未验证 提交 315f8b46 编写于 作者: E eileencodes

Fix missing backticks in errors

These weren't consistent. In some errors we were using backticks and
others we weren't. This fixes `connected_to` errors to use backticks
around the method name
上级 36b76556
......@@ -135,7 +135,7 @@ def connects_to(database: {}, shards: {})
#
# The database kwarg is deprecated and will be removed in 6.2.0 without replacement.
def connected_to(database: nil, role: nil, shard: nil, prevent_writes: false, &blk)
raise NotImplementedError, "connected_to can only be called on ActiveRecord::Base" unless self == Base
raise NotImplementedError, "`connected_to` can only be called on ActiveRecord::Base" unless self == Base
if database
ActiveSupport::Deprecation.warn("The database key in `connected_to` is deprecated. It will be removed in Rails 6.2.0 without replacement.")
......
......@@ -1674,7 +1674,7 @@ def test_protected_environments_are_stored_as_an_array_of_string
Bird.connected_to(role: :reading) { }
end
assert_equal "connected_to can only be called on ActiveRecord::Base", error.message
assert_equal "`connected_to` can only be called on ActiveRecord::Base", error.message
end
test "preventing writes applies to all connections on a handler" do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册