Fix rubocop config and warnings (#15503)
* disable NewCops * update TargetRubyVersion * Fix Lint/MissingSuper for ActiveModelSerializers::Model * Fix Lint/MissingSuper for feed * Fix Lint/FloatComparison * Do not use instance variables
This commit is contained in:
parent
066dbe1e69
commit
efffdd3778
10 changed files with 59 additions and 59 deletions
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PublicFeed < Feed
|
||||
class PublicFeed
|
||||
# @param [Account] account
|
||||
# @param [Hash] options
|
||||
# @option [Boolean] :with_replies
|
||||
|
@ -33,28 +33,30 @@ class PublicFeed < Feed
|
|||
|
||||
private
|
||||
|
||||
attr_reader :account, :options
|
||||
|
||||
def with_reblogs?
|
||||
@options[:with_reblogs]
|
||||
options[:with_reblogs]
|
||||
end
|
||||
|
||||
def with_replies?
|
||||
@options[:with_replies]
|
||||
options[:with_replies]
|
||||
end
|
||||
|
||||
def local_only?
|
||||
@options[:local]
|
||||
options[:local]
|
||||
end
|
||||
|
||||
def remote_only?
|
||||
@options[:remote]
|
||||
options[:remote]
|
||||
end
|
||||
|
||||
def account?
|
||||
@account.present?
|
||||
account.present?
|
||||
end
|
||||
|
||||
def media_only?
|
||||
@options[:only_media]
|
||||
options[:only_media]
|
||||
end
|
||||
|
||||
def public_scope
|
||||
|
@ -82,9 +84,9 @@ class PublicFeed < Feed
|
|||
end
|
||||
|
||||
def account_filters_scope
|
||||
Status.not_excluded_by_account(@account).tap do |scope|
|
||||
scope.merge!(Status.not_domain_blocked_by_account(@account)) unless local_only?
|
||||
scope.merge!(Status.in_chosen_languages(@account)) if @account.chosen_languages.present?
|
||||
Status.not_excluded_by_account(account).tap do |scope|
|
||||
scope.merge!(Status.not_domain_blocked_by_account(account)) unless local_only?
|
||||
scope.merge!(Status.in_chosen_languages(account)) if account.chosen_languages.present?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue