mirror of
https://github.com/discourse/discourse.git
synced 2025-03-24 17:57:22 +08:00
remove unecessary '.limit(1)'
This commit is contained in:
parent
ecdae9f863
commit
fdf749770b
@ -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…
x
Reference in New Issue
Block a user