chore: revert more RuboCop cosmetic changes to reduce PR size
Reverted Layout/EmptyLineAfterGuardClause fixes in: - 29+ controller files - Multiple service, worker, and mailbox files - Several spec files - Enterprise module files This keeps the PR focused on functional Rails 7.2 upgrade changes only.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
class V2::ReportBuilder
|
||||
include DateRangeHelper
|
||||
include ReportHelper
|
||||
|
||||
attr_reader :account, :params
|
||||
|
||||
DEFAULT_GROUP_BY = 'day'.freeze
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class V2::Reports::BotMetricsBuilder
|
||||
include DateRangeHelper
|
||||
|
||||
attr_reader :account, :params
|
||||
|
||||
def initialize(account, params)
|
||||
@@ -42,13 +41,13 @@ class V2::Reports::BotMetricsBuilder
|
||||
end
|
||||
|
||||
def bot_resolution_rate
|
||||
return 0 if bot_conversations.none?
|
||||
return 0 if bot_conversations.count.zero?
|
||||
|
||||
bot_resolutions_count.to_f / bot_conversations.count * 100
|
||||
end
|
||||
|
||||
def bot_handoff_rate
|
||||
return 0 if bot_conversations.none?
|
||||
return 0 if bot_conversations.count.zero?
|
||||
|
||||
bot_handoffs_count.to_f / bot_conversations.count * 100
|
||||
end
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
class V2::Reports::Timeseries::BaseTimeseriesBuilder
|
||||
include TimezoneHelper
|
||||
include DateRangeHelper
|
||||
|
||||
DEFAULT_GROUP_BY = 'day'.freeze
|
||||
|
||||
pattr_initialize :account, :params
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class Api::V1::Accounts::Contacts::ContactInboxesController < Api::V1::Accounts::Contacts::BaseController
|
||||
include HmacConcern
|
||||
|
||||
before_action :ensure_inbox, only: [:create]
|
||||
|
||||
def create
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class Api::V1::Accounts::ContactsController < Api::V1::Accounts::BaseController
|
||||
include Sift
|
||||
|
||||
sort_on :email, type: :string
|
||||
sort_on :name, internal_name: :order_on_name, type: :scope, scope_params: [:direction]
|
||||
sort_on :phone_number, type: :string
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
|
||||
include Api::V1::InboxesHelper
|
||||
|
||||
before_action :fetch_inbox, except: [:index, :create]
|
||||
before_action :fetch_agent_bot, only: [:set_agent_bot]
|
||||
before_action :validate_limit, only: [:create]
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class Api::V1::Widget::ConversationsController < Api::V1::Widget::BaseController
|
||||
include Events::Types
|
||||
|
||||
before_action :render_not_found_if_empty, only: [:toggle_typing, :toggle_status, :set_custom_attributes, :destroy_custom_attributes]
|
||||
|
||||
def index
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class Api::V1::Widget::DirectUploadsController < ActiveStorage::DirectUploadsController
|
||||
include WebsiteTokenHelper
|
||||
|
||||
before_action :set_web_widget
|
||||
before_action :set_contact
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class DeviseOverrides::ConfirmationsController < Devise::ConfirmationsController
|
||||
include AuthHelper
|
||||
|
||||
skip_before_action :require_no_authentication, raise: false
|
||||
skip_before_action :authenticate_user!, raise: false
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class Public::Api::V1::Inboxes::ConversationsController < Public::Api::V1::InboxesController
|
||||
include Events::Types
|
||||
|
||||
before_action :set_conversation, only: [:toggle_typing, :update_last_seen, :show, :toggle_status]
|
||||
|
||||
def index
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
# One of the specs is failing when I tried doing that, lets revisit in future
|
||||
class PublicController < ActionController::Base
|
||||
include RequestExceptionHandler
|
||||
|
||||
skip_before_action :verify_authenticity_token
|
||||
|
||||
private
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class SlackUploadsController < ApplicationController
|
||||
include Rails.application.routes.url_helpers
|
||||
|
||||
before_action :set_blob, only: [:show]
|
||||
|
||||
def show
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
class Imap::ImapMailbox
|
||||
include MailboxHelper
|
||||
include IncomingEmailValidityHelper
|
||||
|
||||
attr_accessor :channel, :account, :inbox, :conversation, :processed_mail
|
||||
|
||||
def process(mail, channel)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class SupportMailbox < ApplicationMailbox
|
||||
include IncomingEmailValidityHelper
|
||||
|
||||
attr_accessor :channel, :account, :inbox, :conversation, :processed_mail
|
||||
|
||||
before_processing :find_channel,
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
class Channel::Instagram < ApplicationRecord
|
||||
include Channelable
|
||||
include Reauthorizable
|
||||
|
||||
self.table_name = 'channel_instagram'
|
||||
|
||||
AUTHORIZATION_ERROR_THRESHOLD = 1
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
class Notification < ApplicationRecord
|
||||
include MessageFormatHelper
|
||||
|
||||
belongs_to :account
|
||||
belongs_to :user
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
class Account::SignUpEmailValidationService
|
||||
include CustomExceptions::Account
|
||||
|
||||
attr_reader :email
|
||||
|
||||
def initialize(email)
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
class Line::IncomingMessageService
|
||||
include ::FileTypeHelper
|
||||
|
||||
pattr_initialize [:inbox!, :params!]
|
||||
LINE_STICKER_IMAGE_URL = 'https://stickershop.line-scdn.net/stickershop/v1/sticker/%s/android/sticker.png'.freeze
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
class Telegram::IncomingMessageService
|
||||
include ::FileTypeHelper
|
||||
include ::Telegram::ParamHelpers
|
||||
|
||||
pattr_initialize [:inbox!, :params!]
|
||||
|
||||
def perform
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# TODO: lets move this to active job, since thats what we use over all
|
||||
class ConversationReplyEmailWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
sidekiq_options queue: :mailers
|
||||
|
||||
def perform(conversation_id, last_queued_id)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class EmailReplyWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
sidekiq_options queue: :mailers, retry: 3
|
||||
|
||||
def perform(message_id)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class Enterprise::Api::V1::AccountsController < Api::BaseController
|
||||
include BillingHelper
|
||||
|
||||
before_action :fetch_account
|
||||
before_action :check_authorization
|
||||
before_action :check_cloud_env, only: [:limits, :toggle_deletion]
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module Enterprise::ActionCableListener
|
||||
include Events::Types
|
||||
|
||||
def copilot_message_created(event)
|
||||
copilot_message = event.data[:copilot_message]
|
||||
copilot_thread = copilot_message.copilot_thread
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class Integrations::Slack::SendOnSlackService < Base::SendOnChannelService
|
||||
include RegexHelper
|
||||
|
||||
pattr_initialize [:message!, :hook!]
|
||||
|
||||
def perform
|
||||
|
||||
@@ -2,7 +2,6 @@ require 'rails_helper'
|
||||
|
||||
describe V2::ReportBuilder do
|
||||
include ActiveJob::TestHelper
|
||||
|
||||
let_it_be(:account) { create(:account) }
|
||||
let_it_be(:label_1) { create(:label, title: 'Label_1', account: account) }
|
||||
let_it_be(:label_2) { create(:label, title: 'Label_2', account: account) }
|
||||
|
||||
@@ -2,7 +2,6 @@ require 'rails_helper'
|
||||
|
||||
RSpec.describe 'Api::V1::Accounts::BulkActionsController', type: :request do
|
||||
include ActiveJob::TestHelper
|
||||
|
||||
let(:account) { create(:account) }
|
||||
let(:agent_1) { create(:user, account: account, role: :agent) }
|
||||
let(:agent_2) { create(:user, account: account, role: :agent) }
|
||||
|
||||
@@ -2,7 +2,6 @@ require 'rails_helper'
|
||||
|
||||
RSpec.describe Enterprise::CreateStripeCustomerJob, type: :job do
|
||||
include ActiveJob::TestHelper
|
||||
|
||||
subject(:job) { described_class.perform_later(account) }
|
||||
|
||||
let(:account) { create(:account) }
|
||||
|
||||
@@ -2,7 +2,6 @@ require 'rails_helper'
|
||||
|
||||
RSpec.describe DeleteObjectJob, type: :job do
|
||||
include ActiveJob::TestHelper
|
||||
|
||||
subject(:job) { described_class.perform_later(account) }
|
||||
|
||||
let(:account) { create(:account) }
|
||||
|
||||
@@ -2,7 +2,6 @@ require 'rails_helper'
|
||||
|
||||
RSpec.describe SlaPolicy, type: :model do
|
||||
include ActiveJob::TestHelper
|
||||
|
||||
let(:account) { create(:account) }
|
||||
let(:admin) { create(:user, account: account, role: :administrator) }
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ require 'rails_helper'
|
||||
|
||||
describe EmailChannelFinder do
|
||||
include ActionMailbox::TestHelper
|
||||
|
||||
let!(:channel_email) { create(:channel_email) }
|
||||
|
||||
describe '#perform' do
|
||||
|
||||
@@ -7,7 +7,6 @@ RSpec.describe MailboxHelper do
|
||||
let(:mailbox_helper_obj) do
|
||||
Class.new do
|
||||
include MailboxHelper
|
||||
|
||||
attr_accessor :conversation, :processed_mail
|
||||
|
||||
def initialize(conversation, processed_mail)
|
||||
|
||||
@@ -2,7 +2,6 @@ require 'rails_helper'
|
||||
|
||||
RSpec.describe Imap::FetchEmailService do
|
||||
include ActionMailbox::TestHelper
|
||||
|
||||
let(:logger) { instance_double(ActiveSupport::Logger, info: true, error: true) }
|
||||
let(:account) { create(:account) }
|
||||
let(:imap_email_channel) { create(:channel_email, :imap_email, account: account) }
|
||||
|
||||
@@ -2,7 +2,6 @@ require 'rails_helper'
|
||||
|
||||
RSpec.describe Imap::MicrosoftFetchEmailService do
|
||||
include ActionMailbox::TestHelper
|
||||
|
||||
let(:logger) { instance_double(ActiveSupport::Logger, info: true, error: true) }
|
||||
let(:account) { create(:account) }
|
||||
let(:microsoft_channel) { create(:channel_email, :microsoft_email, account: account) }
|
||||
|
||||
Reference in New Issue
Block a user