mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 15:58:17 +08: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:
@ -109,7 +109,7 @@ class Search
|
||||
|
||||
# If we're searching for a single topic
|
||||
def single_topic(id)
|
||||
topic = Topic.where(id: id).first
|
||||
topic = Topic.find_by(id: id)
|
||||
return nil unless @guardian.can_see?(topic)
|
||||
|
||||
@results.add_result(SearchResult.from_topic(topic))
|
||||
|
Reference in New Issue
Block a user