提交 9bed2269 编写于 作者: A Akira Matsuda

AR::Base#write_attribute is a public method

上级 2d74f6c1
......@@ -298,13 +298,13 @@ def setup
test "write_attribute" do
topic = Topic.new
topic.send(:write_attribute, :title, "Still another topic")
topic.write_attribute :title, "Still another topic"
assert_equal "Still another topic", topic.title
topic[:title] = "Still another topic: part 2"
assert_equal "Still another topic: part 2", topic.title
topic.send(:write_attribute, "title", "Still another topic: part 3")
topic.write_attribute "title", "Still another topic: part 3"
assert_equal "Still another topic: part 3", topic.title
topic["title"] = "Still another topic: part 4"
......@@ -395,13 +395,13 @@ def topic.write_attribute(attr_name, value)
super(attr_name, value.downcase)
end
topic.send(:write_attribute, :title, "Yet another topic")
topic.write_attribute :title, "Yet another topic"
assert_equal "yet another topic", topic.title
topic[:title] = "Yet another topic: part 2"
assert_equal "yet another topic: part 2", topic.title
topic.send(:write_attribute, "title", "Yet another topic: part 3")
topic.write_attribute "title", "Yet another topic: part 3"
assert_equal "yet another topic: part 3", topic.title
topic["title"] = "Yet another topic: part 4"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册