0
0
Fork 0

Fix various things in the directory (#9449)

* Fix missing variable in directory page title

* Order hashtags by number of people instead of alphabetically

* Add icon to OpenGraph preview of directory page

* Prevent line breaks in hashtags and ensure lowercase in the table
This commit is contained in:
Eugen Rochko 2018-12-07 16:37:32 +01:00 committed by GitHub
parent c1c0f7c516
commit ecd303c097
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View file

@ -20,7 +20,7 @@ class Tag < ApplicationRecord
validates :name, presence: true, uniqueness: true, format: { with: /\A#{HASHTAG_NAME_RE}\z/i }
scope :discoverable, -> { joins(:account_tag_stat).where(AccountTagStat.arel_table[:accounts_count].gt(0)).where(account_tag_stats: { hidden: false }).order(name: :asc) }
scope :discoverable, -> { joins(:account_tag_stat).where(AccountTagStat.arel_table[:accounts_count].gt(0)).where(account_tag_stats: { hidden: false }).order('account_tag_stats.accounts_count desc') }
scope :hidden, -> { where(account_tag_stats: { hidden: true }) }
delegate :accounts_count,