mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
remove unecessary '.limit(1)'
This commit is contained in:
@ -426,7 +426,7 @@ class ApplicationController < ActionController::Base
|
|||||||
json = ApplicationController.banner_json_cache["json"]
|
json = ApplicationController.banner_json_cache["json"]
|
||||||
|
|
||||||
unless json
|
unless json
|
||||||
topic = Topic.where(archetype: Archetype.banner).limit(1).first
|
topic = Topic.where(archetype: Archetype.banner).first
|
||||||
banner = topic.present? ? topic.banner : {}
|
banner = topic.present? ? topic.banner : {}
|
||||||
ApplicationController.banner_json_cache["json"] = json = MultiJson.dump(banner)
|
ApplicationController.banner_json_cache["json"] = json = MultiJson.dump(banner)
|
||||||
end
|
end
|
||||||
|
@ -848,7 +848,7 @@ SQL
|
|||||||
end
|
end
|
||||||
|
|
||||||
def banner
|
def banner
|
||||||
post = self.posts.order(:post_number).limit(1).first
|
post = self.ordered_posts.first
|
||||||
|
|
||||||
{
|
{
|
||||||
html: post.cooked,
|
html: post.cooked,
|
||||||
|
Reference in New Issue
Block a user