Merge remote-tracking branch 'parent/main' into kb_migration
This commit is contained in:
commit
de4aadb0a1
5 changed files with 23 additions and 10 deletions
|
@ -548,8 +548,21 @@ class Account < ApplicationRecord
|
|||
EntityCache.instance.mention(username, domain)
|
||||
end
|
||||
end
|
||||
|
||||
def inverse_alias(key, original_key)
|
||||
define_method("#{key}=") do |value|
|
||||
public_send("#{original_key}=", !ActiveModel::Type::Boolean.new.cast(value))
|
||||
end
|
||||
|
||||
define_method(key) do
|
||||
!public_send(original_key)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
inverse_alias :show_collections, :hide_collections
|
||||
inverse_alias :unlocked, :locked
|
||||
|
||||
def emojis
|
||||
@emojis ||= CustomEmoji.from_text(emojifiable_text, domain)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue