mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Perform the where(...).first to find_by(...) refactoring.
This refactoring was automated using the command: bundle exec "ruby refactorings/where_dot_first_to_find_by/app.rb"
This commit is contained in:
@@ -33,7 +33,7 @@ class TopicLinkClick < ActiveRecord::Base
|
||||
|
||||
# If we have it somewhere else on the site, just allow the redirect. This is
|
||||
# likely due to a onebox of another topic.
|
||||
link = TopicLink.where(url: args[:url]).first
|
||||
link = TopicLink.find_by(url: args[:url])
|
||||
return link.present? ? link.url : nil
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user