Apply Rubocop Style/NegatedIfElseCondition (#23451)
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
class Api::V1::StreamingController < Api::BaseController
|
||||
def index
|
||||
if Rails.configuration.x.streaming_api_base_url != request.host
|
||||
redirect_to streaming_api_url, status: 301
|
||||
else
|
||||
if Rails.configuration.x.streaming_api_base_url == request.host
|
||||
not_found
|
||||
else
|
||||
redirect_to streaming_api_url, status: 301
|
||||
end
|
||||
end
|
||||
|
||||
|
@@ -265,7 +265,7 @@ class User < ApplicationRecord
|
||||
end
|
||||
|
||||
def inactive_message
|
||||
!approved? ? :pending : super
|
||||
approved? ? super : :pending
|
||||
end
|
||||
|
||||
def approve!
|
||||
|
@@ -82,7 +82,7 @@ class FetchOEmbedService
|
||||
return if @endpoint_url.blank?
|
||||
|
||||
body = Request.new(:get, @endpoint_url).perform do |res|
|
||||
res.code != 200 ? nil : res.body_with_limit
|
||||
res.code == 200 ? res.body_with_limit : nil
|
||||
end
|
||||
|
||||
validate(parse_for_format(body)) if body.present?
|
||||
|
@@ -19,7 +19,7 @@ class VerifyLinkService < BaseService
|
||||
|
||||
def perform_request!
|
||||
@body = Request.new(:get, @url).add_headers('Accept' => 'text/html').perform do |res|
|
||||
res.code != 200 ? nil : res.body_with_limit
|
||||
res.code == 200 ? res.body_with_limit : nil
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user