diff options
Diffstat (limited to 'app/models/account.rb')
-rw-r--r-- | app/models/account.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/models/account.rb b/app/models/account.rb index ac27c7923..de7998db4 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -52,7 +52,6 @@ class Account < ApplicationRecord include AccountInteractions include Attachmentable include Remotable - include EmojiHelper MAX_NOTE_LENGTH = 500 @@ -106,6 +105,7 @@ class Account < ApplicationRecord scope :by_domain_accounts, -> { group(:domain).select(:domain, 'COUNT(*) AS accounts_count').order('accounts_count desc') } scope :matches_username, ->(value) { where(arel_table[:username].matches("#{value}%")) } scope :matches_display_name, ->(value) { where(arel_table[:display_name].matches("#{value}%")) } + scope :matches_domain, ->(value) { where(arel_table[:domain].matches("%#{value}%")) } delegate :email, :current_sign_in_ip, @@ -174,6 +174,10 @@ class Account < ApplicationRecord end class << self + def readonly_attributes + super - %w(statuses_count following_count followers_count) + end + def domains reorder(nil).pluck('distinct accounts.domain') end @@ -266,9 +270,6 @@ class Account < ApplicationRecord def prepare_contents display_name&.strip! note&.strip! - - self.display_name = emojify(display_name) - self.note = emojify(note) end def generate_keys |