0
0
Fork 0

Add CustomEmoji.enabled scope (#31830)

This commit is contained in:
Matt Jankowski 2024-09-10 09:21:40 -04:00 committed by GitHub
parent e0c27a5047
commit da07adfe6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 3 deletions

View file

@ -48,9 +48,10 @@ class CustomEmoji < ApplicationRecord
scope :local, -> { where(domain: nil) }
scope :remote, -> { where.not(domain: nil) }
scope :enabled, -> { where(disabled: false) }
scope :alphabetic, -> { order(domain: :asc, shortcode: :asc) }
scope :by_domain_and_subdomains, ->(domain) { where(domain: domain).or(where(arel_table[:domain].matches("%.#{domain}"))) }
scope :listed, -> { local.where(disabled: false).where(visible_in_picker: true) }
scope :listed, -> { local.enabled.where(visible_in_picker: true) }
remotable_attachment :image, LIMIT