Fix Style/InverseMethods cop (#28377)
				
					
				
			This commit is contained in:
		
							parent
							
								
									3e336fe706
								
							
						
					
					
						commit
						b1dec09d20
					
				@ -362,14 +362,6 @@ Style/IfUnlessModifier:
 | 
				
			|||||||
    - 'config/initializers/devise.rb'
 | 
					    - 'config/initializers/devise.rb'
 | 
				
			||||||
    - 'config/initializers/ffmpeg.rb'
 | 
					    - 'config/initializers/ffmpeg.rb'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# This cop supports unsafe autocorrection (--autocorrect-all).
 | 
					 | 
				
			||||||
# Configuration parameters: InverseMethods, InverseBlocks.
 | 
					 | 
				
			||||||
Style/InverseMethods:
 | 
					 | 
				
			||||||
  Exclude:
 | 
					 | 
				
			||||||
    - 'app/models/custom_filter.rb'
 | 
					 | 
				
			||||||
    - 'app/services/update_account_service.rb'
 | 
					 | 
				
			||||||
    - 'spec/controllers/activitypub/replies_controller_spec.rb'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# This cop supports unsafe autocorrection (--autocorrect-all).
 | 
					# This cop supports unsafe autocorrection (--autocorrect-all).
 | 
				
			||||||
Style/MapToHash:
 | 
					Style/MapToHash:
 | 
				
			||||||
  Exclude:
 | 
					  Exclude:
 | 
				
			||||||
 | 
				
			|||||||
@ -91,7 +91,7 @@ class CustomFilter < ApplicationRecord
 | 
				
			|||||||
      filters_hash.values.map { |cache| [cache.delete(:filter), cache] }
 | 
					      filters_hash.values.map { |cache| [cache.delete(:filter), cache] }
 | 
				
			||||||
    end.to_a
 | 
					    end.to_a
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    active_filters.select { |custom_filter, _| !custom_filter.expired? }
 | 
					    active_filters.reject { |custom_filter, _| custom_filter.expired? }
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def self.apply_cached_filters(cached_filters, status)
 | 
					  def self.apply_cached_filters(cached_filters, status)
 | 
				
			||||||
 | 
				
			|||||||
@ -21,7 +21,7 @@ class UpdateAccountService < BaseService
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  def authorize_all_follow_requests(account)
 | 
					  def authorize_all_follow_requests(account)
 | 
				
			||||||
    follow_requests = FollowRequest.where(target_account: account)
 | 
					    follow_requests = FollowRequest.where(target_account: account)
 | 
				
			||||||
    follow_requests = follow_requests.preload(:account).select { |req| !req.account.silenced? }
 | 
					    follow_requests = follow_requests.preload(:account).reject { |req| req.account.silenced? }
 | 
				
			||||||
    AuthorizeFollowWorker.push_bulk(follow_requests, limit: 1_000) do |req|
 | 
					    AuthorizeFollowWorker.push_bulk(follow_requests, limit: 1_000) do |req|
 | 
				
			||||||
      [req.account_id, req.target_account_id]
 | 
					      [req.account_id, req.target_account_id]
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
				
			|||||||
@ -123,7 +123,7 @@ RSpec.describe ActivityPub::RepliesController do
 | 
				
			|||||||
        end
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        it 'uses ids for remote toots' do
 | 
					        it 'uses ids for remote toots' do
 | 
				
			||||||
          remote_replies = page_json[:items].select { |x| !x.is_a?(Hash) }
 | 
					          remote_replies = page_json[:items].reject { |x| x.is_a?(Hash) }
 | 
				
			||||||
          expect(remote_replies.all? { |item| item.is_a?(String) && !ActivityPub::TagManager.instance.local_uri?(item) }).to be true
 | 
					          expect(remote_replies.all? { |item| item.is_a?(String) && !ActivityPub::TagManager.instance.local_uri?(item) }).to be true
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user