Change “privacy and reach” settings so that unchecking boxes always increase privacy and checking them always increase reach (#26508)
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user