chore: Apply fixes for items in rubocop_todo [CW-1806] (#8864)

This PR addresses several items listed in our rubocop_todo by implementing the necessary corrections and enhancements. As a result, we are now able to remove the rubocop_todo file entirely, streamlining our codebase and ensuring adherence to our coding standards.

fixes: https://linear.app/chatwoot/issue/CW-1806/chore-rubocop-audit
This commit is contained in:
Sojan Jose
2024-02-07 13:36:04 +04:00
committed by GitHub
parent 3abb887445
commit 7776b74126
21 changed files with 67 additions and 398 deletions

View File

@@ -9,6 +9,6 @@ class Events::Base
end
def method_name
name.to_s.gsub('.', '_')
name.to_s.tr('.', '_')
end
end

View File

@@ -16,7 +16,7 @@ class Integrations::Widget::OutgoingMessageBuilder
def perform
ActiveRecord::Base.transaction do
build_conversation
conversation
build_message
end
end
@@ -31,19 +31,19 @@ class Integrations::Widget::OutgoingMessageBuilder
@user ||= Contact.find(options[:user_id])
end
def build_conversation
def conversation
@conversation ||= Conversation.find(options[:conversation_id])
end
def build_message
@message = @conversation.messages.new(message_params)
@message = conversation.messages.new(message_params)
@message.save!
end
def message_params
{
account_id: @conversation.account_id,
inbox_id: @conversation.inbox_id,
account_id: conversation.account_id,
inbox_id: conversation.inbox_id,
message_type: 1,
content: options[:content],
sender: user