Change “privacy and reach” settings so that unchecking boxes always increase privacy and checking them always increase reach (#26508)
This commit is contained in:
parent
0446394465
commit
cc4560d95b
4 changed files with 20 additions and 7 deletions
|
@ -442,8 +442,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