Clarify the origin of this great addition to Rails :trollface: :trollface :trollface:

上级 96194504
......@@ -35,7 +35,7 @@ def test_presence
end
def test_presence_with_a_block
assert_equal "SALLY", "sally".presence { upcase } || "Nobody"
assert_equal "THIS WAS TENDERLOVE'S IDEA", "this was tenderlove's idea".presence { upcase } || "Nobody"
assert_equal "Nobody", nil.presence { upcase } || "Nobody"
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册