mirror of
https://github.com/discourse/discourse.git
synced 2025-08-21 19:11:18 +08:00
remove unecessary '.limit(1)'
This commit is contained in:
parent
ecdae9f863
commit
fdf749770b
2 changed files with 2 additions and 2 deletions
|
@ -426,7 +426,7 @@ class ApplicationController < ActionController::Base
|
|||
json = ApplicationController.banner_json_cache["json"]
|
||||
|
||||
unless json
|
||||
topic = Topic.where(archetype: Archetype.banner).limit(1).first
|
||||
topic = Topic.where(archetype: Archetype.banner).first
|
||||
banner = topic.present? ? topic.banner : {}
|
||||
ApplicationController.banner_json_cache["json"] = json = MultiJson.dump(banner)
|
||||
end
|
||||
|
|
|
@ -848,7 +848,7 @@ SQL
|
|||
end
|
||||
|
||||
def banner
|
||||
post = self.posts.order(:post_number).limit(1).first
|
||||
post = self.ordered_posts.first
|
||||
|
||||
{
|
||||
html: post.cooked,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue