Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: space
+Lint/UselessAccessModifier:
+ ContextCreatingMethods:
+ - class_methods
+
Metrics/AbcSize:
Max: 100
user = User.authenticate_with_ldap(user_params) if Devise.ldap_authentication
user ||= User.authenticate_with_pam(user_params) if Devise.pam_authentication
user ||= User.find_for_authentication(email: user_params[:email])
+ user
end
end
expires_in 0, public: true
limit = params[:limit].present? ? [params[:limit].to_i, PAGE_SIZE_MAX].min : PAGE_SIZE
- @statuses = HashtagQueryService.new.call(@tag, filter_params, nil, @local).limit(PAGE_SIZE)
+ @statuses = HashtagQueryService.new.call(@tag, filter_params, nil, @local).limit(limit)
@statuses = cache_collection(@statuses, Status)
render xml: RSS::TagSerializer.render(@tag, @statuses)
RedisLock.acquire(lock_options) do |lock|
if lock.acquired?
- return if delete_arrived_first?(object_uri) || poll_vote?
+ return if delete_arrived_first?(object_uri) || poll_vote? # rubocop:disable Lint/NonLocalExitFromIterator
@status = find_existing_status
end
def profile_url
- CGI.unescape(short_account_url('%{username}')) # rubocop:disable Style/FormatStringToken
+ CGI.unescape(short_account_url('%{username}'))
end
def check_url
begin
sock.connect_nonblock(addr_by_socket[sock])
rescue Errno::EISCONN
+ # Do nothing
rescue => e
sock.close
outer_e = e
@object = object
end
- # rubocop:disable Style/MethodMissing
+ # rubocop:disable Style/MethodMissingSuper
def method_missing(method, *args)
method_name = method.to_s
# set a value for a variable
self[method_name]
end
end
- # rubocop:enable Style/MethodMissing
+ # rubocop:enable Style/MethodMissingSuper
def respond_to_missing?(*)
true
record.update!(value: value)
Rails.cache.write(Setting.cache_key(key, @object), value)
- value
end
def [](key)
user = User.new(user_params_from_auth(email, auth))
- user.account.avatar_remote_url = auth.info.image if auth.info.image =~ /\A#{URI.regexp(%w(http https))}\z/
+ user.account.avatar_remote_url = auth.info.image if auth.info.image =~ /\A#{URI::DEFAULT_PARSER.make_regexp(%w(http https))}\z/
user.skip_confirmation!
user.save!
user