DEV: Prefer .pluck_first over .pluck.first (#13607)

This commit is contained in:
Dan Ungureanu
2021-07-02 10:03:54 +08:00
committed by GitHub
parent 3db4ed113b
commit 6ea4bbd2ec
4 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -58,8 +58,8 @@ describe TopicLink do
TopicLink.extract_from(post)
# we have a special rule for images title where we pull them out of the filename
expect(topic.topic_links.where(url: png).pluck(:title).first).to eq(png_title)
expect(topic.topic_links.where(url: non_png).pluck(:title).first).to eq("amazing")
expect(topic.topic_links.where(url: png).pluck_first(:title)).to eq(png_title)
expect(topic.topic_links.where(url: non_png).pluck_first(:title)).to eq("amazing")
expect(topic.topic_links.pluck(:url)).to contain_exactly(
png,