#1140: Use fast reltag calculation for subquery metatags
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
class Tag < ActiveRecord::Base
|
class Tag < ActiveRecord::Base
|
||||||
METATAGS = "-user|user|-approver|approver|commenter|comm|noter|noteupdater|artcomm|-pool|pool|-fav|fav|ordfav|sub|md5|-rating|rating|-locked|locked|width|height|mpixels|score|favcount|filesize|source|-source|id|-id|date|age|order|limit|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|-parent|child|pixiv_id|pixiv"
|
METATAGS = "-user|user|-approver|approver|commenter|comm|noter|noteupdater|artcomm|-pool|pool|-fav|fav|ordfav|sub|md5|-rating|rating|-locked|locked|width|height|mpixels|score|favcount|filesize|source|-source|id|-id|date|age|order|limit|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|-parent|child|pixiv_id|pixiv"
|
||||||
|
SUBQUERY_METATAGS = "commenter|comm|noter|noteupdater|artcomm"
|
||||||
attr_accessible :category, :as => [:moderator, :janitor, :contributor, :gold, :member, :anonymous, :default, :builder, :admin]
|
attr_accessible :category, :as => [:moderator, :janitor, :contributor, :gold, :member, :anonymous, :default, :builder, :admin]
|
||||||
attr_accessible :is_locked, :as => [:moderator, :janitor, :admin]
|
attr_accessible :is_locked, :as => [:moderator, :janitor, :admin]
|
||||||
has_one :wiki_page, :foreign_key => "title", :primary_key => "name"
|
has_one :wiki_page, :foreign_key => "title", :primary_key => "name"
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ module PostSetPresenters
|
|||||||
post_set.tag_subscription_tags
|
post_set.tag_subscription_tags
|
||||||
elsif post_set.is_single_tag?
|
elsif post_set.is_single_tag?
|
||||||
related_tags_for_single
|
related_tags_for_single
|
||||||
|
elsif post_set.tag_string =~ /(?:^|\s)(?:#{Tag::SUBQUERY_METATAGS}):\S+/
|
||||||
|
calculate_related_tags_from_post_set
|
||||||
elsif post_set.is_empty_tag?
|
elsif post_set.is_empty_tag?
|
||||||
popular_tags
|
popular_tags
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user