Autofix Rubocop Style/Lambda (#23696)
This commit is contained in:
		@@ -101,12 +101,12 @@ class Status < ApplicationRecord
 | 
			
		||||
  scope :including_silenced_accounts, -> { left_outer_joins(:account).where.not(accounts: { silenced_at: nil }) }
 | 
			
		||||
  scope :not_excluded_by_account, ->(account) { where.not(account_id: account.excluded_from_timeline_account_ids) }
 | 
			
		||||
  scope :not_domain_blocked_by_account, ->(account) { account.excluded_from_timeline_domains.blank? ? left_outer_joins(:account) : left_outer_joins(:account).where('accounts.domain IS NULL OR accounts.domain NOT IN (?)', account.excluded_from_timeline_domains) }
 | 
			
		||||
  scope :tagged_with_all, ->(tag_ids) {
 | 
			
		||||
  scope :tagged_with_all, lambda { |tag_ids|
 | 
			
		||||
    Array(tag_ids).map(&:to_i).reduce(self) do |result, id|
 | 
			
		||||
      result.joins("INNER JOIN statuses_tags t#{id} ON t#{id}.status_id = statuses.id AND t#{id}.tag_id = #{id}")
 | 
			
		||||
    end
 | 
			
		||||
  }
 | 
			
		||||
  scope :tagged_with_none, ->(tag_ids) {
 | 
			
		||||
  scope :tagged_with_none, lambda { |tag_ids|
 | 
			
		||||
    where('NOT EXISTS (SELECT * FROM statuses_tags forbidden WHERE forbidden.status_id = statuses.id AND forbidden.tag_id IN (?))', tag_ids)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user