Skip to content

Commit

Permalink
AR::Base#write_attribute is a public method
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed Sep 16, 2020
1 parent 2d74f6c commit 9bed226
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions activerecord/test/cases/attribute_methods_test.rb
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 9bed226

Please sign in to comment.