forked from fedi/mastodon
Fix Rubocop offences (#2630)
* disable Bundler/OrderedGems * fix rubocop Lint/UselessAssignment * fix rubocop Style/BlockDelimiters * fix rubocop Style/AlignHash * fix rubocop Style/AlignParameters, Style/EachWithObject * fix rubocop Style/SpaceInLambdaLiteral
This commit is contained in:
parent
1899cf5f04
commit
3988f2dade
|
@ -77,6 +77,9 @@ Style/Lambda:
|
||||||
Rails/HasAndBelongsToMany:
|
Rails/HasAndBelongsToMany:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Bundler/OrderedGems:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
AllCops:
|
AllCops:
|
||||||
TargetRubyVersion: 2.3
|
TargetRubyVersion: 2.3
|
||||||
Exclude:
|
Exclude:
|
||||||
|
|
|
@ -51,7 +51,7 @@ class Auth::SessionsController < Devise::SessionsController
|
||||||
def valid_otp_attempt?(user)
|
def valid_otp_attempt?(user)
|
||||||
user.validate_and_consume_otp!(user_params[:otp_attempt]) ||
|
user.validate_and_consume_otp!(user_params[:otp_attempt]) ||
|
||||||
user.invalidate_otp_backup_code!(user_params[:otp_attempt])
|
user.invalidate_otp_backup_code!(user_params[:otp_attempt])
|
||||||
rescue OpenSSL::Cipher::CipherError => error
|
rescue OpenSSL::Cipher::CipherError => _error
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,9 @@ module Localized
|
||||||
end
|
end
|
||||||
|
|
||||||
def default_locale
|
def default_locale
|
||||||
ENV.fetch('DEFAULT_LOCALE') {
|
ENV.fetch('DEFAULT_LOCALE') do
|
||||||
user_supplied_locale || I18n.default_locale
|
user_supplied_locale || I18n.default_locale
|
||||||
}
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_supplied_locale
|
def user_supplied_locale
|
||||||
|
|
|
@ -329,7 +329,7 @@ class Account < ApplicationRecord
|
||||||
private
|
private
|
||||||
|
|
||||||
def follow_mapping(query, field)
|
def follow_mapping(query, field)
|
||||||
query.pluck(field).inject({}) { |mapping, id| mapping[id] = true; mapping }
|
query.pluck(field).each_with_object({}) { |id, mapping| mapping[id] = true }
|
||||||
end
|
end
|
||||||
|
|
||||||
def avatar_styles(file)
|
def avatar_styles(file)
|
||||||
|
|
|
@ -4,7 +4,7 @@ module Paginable
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
included do
|
included do
|
||||||
scope :paginate_by_max_id, -> (limit, max_id = nil, since_id = nil) {
|
scope :paginate_by_max_id, ->(limit, max_id = nil, since_id = nil) {
|
||||||
query = order(arel_table[:id].desc).limit(limit)
|
query = order(arel_table[:id].desc).limit(limit)
|
||||||
query = query.where(arel_table[:id].lt(max_id)) unless max_id.blank?
|
query = query.where(arel_table[:id].lt(max_id)) unless max_id.blank?
|
||||||
query = query.where(arel_table[:id].gt(since_id)) unless since_id.blank?
|
query = query.where(arel_table[:id].gt(since_id)) unless since_id.blank?
|
||||||
|
|
Loading…
Reference in a new issue