Sprinkle frozen string literal & Indentation Fix (#150)
* Avoid extra string alocation as join will always return string * Fix indentation * Sprinkle frozen string literal true
This commit is contained in:
committed by
Sojan Jose
parent
59e9fbd336
commit
a1452d7d89
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class AccountBuilder
|
class AccountBuilder
|
||||||
include CustomExceptions::Account
|
include CustomExceptions::Account
|
||||||
|
|
||||||
@@ -59,7 +61,6 @@ class AccountBuilder
|
|||||||
else
|
else
|
||||||
raise UserErrors.new({errors: @user.errors})
|
raise UserErrors.new({errors: @user.errors})
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def email_to_name(email)
|
def email_to_name(email)
|
||||||
@@ -67,5 +68,4 @@ class AccountBuilder
|
|||||||
name.split(".").map {|n| n.capitalize }.join(" ")
|
name.split(".").map {|n| n.capitalize }.join(" ")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class ApplicationController < ActionController::Base
|
|||||||
|
|
||||||
def render_record_invalid(exception)
|
def render_record_invalid(exception)
|
||||||
render json: {
|
render json: {
|
||||||
message: "#{exception.record.errors.full_messages.join(", ")}"
|
message: exception.record.errors.full_messages.join(", ")
|
||||||
}, status: :unprocessable_entity
|
}, status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ class ConfirmationsController < Devise::ConfirmationsController
|
|||||||
skip_before_action :require_no_authentication, raise: false
|
skip_before_action :require_no_authentication, raise: false
|
||||||
skip_before_action :authenticate_user!, raise: false
|
skip_before_action :authenticate_user!, raise: false
|
||||||
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
begin
|
begin
|
||||||
@confirmable = User.find_by(confirmation_token: params[:confirmation_token])
|
@confirmable = User.find_by(confirmation_token: params[:confirmation_token])
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Constants::Report
|
module Constants::Report
|
||||||
ACCOUNT_METRICS = [ :conversations_count,
|
ACCOUNT_METRICS = [ :conversations_count,
|
||||||
:incoming_messages_count,
|
:incoming_messages_count,
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module CustomExceptions::Account
|
module CustomExceptions::Account
|
||||||
|
|
||||||
class InvalidEmail < CustomExceptions::Base
|
class InvalidEmail < CustomExceptions::Base
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class CustomExceptions::Base < ::StandardError
|
class CustomExceptions::Base < ::StandardError
|
||||||
|
|
||||||
def to_hash
|
def to_hash
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module CustomExceptions::Report
|
module CustomExceptions::Report
|
||||||
class InvalidIdentity < CustomExceptions::Base
|
class InvalidIdentity < CustomExceptions::Base
|
||||||
def message
|
def message
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Events::Types
|
module Events::Types
|
||||||
CONVERSATION_CREATED = 'conversation.created'
|
CONVERSATION_CREATED = 'conversation.created'
|
||||||
CONVERSATION_RESOLVED = 'conversation.resolved'
|
CONVERSATION_RESOLVED = 'conversation.resolved'
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Integrations::Facebook::DeliveryStatus
|
class Integrations::Facebook::DeliveryStatus
|
||||||
|
|
||||||
def initialize(params)
|
def initialize(params)
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Integrations::Facebook::MessageCreator
|
class Integrations::Facebook::MessageCreator
|
||||||
|
|
||||||
attr_reader :response
|
attr_reader :response
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Integrations::Facebook::MessageParser
|
class Integrations::Facebook::MessageParser
|
||||||
|
|
||||||
def initialize(response_json)
|
def initialize(response_json)
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Integrations::Widget::IncomingMessageBuilder
|
class Integrations::Widget::IncomingMessageBuilder
|
||||||
# params = {
|
# params = {
|
||||||
# contact_id: 1,
|
# contact_id: 1,
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Integrations::Widget::OutgoingMessageBuilder
|
class Integrations::Widget::OutgoingMessageBuilder
|
||||||
# params = {
|
# params = {
|
||||||
# user_id: 1,
|
# user_id: 1,
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Reports::UpdateAccountIdentity < Reports::UpdateIdentity
|
class Reports::UpdateAccountIdentity < Reports::UpdateIdentity
|
||||||
attr_reader :account
|
attr_reader :account
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Reports::UpdateAgentIdentity < Reports::UpdateIdentity
|
class Reports::UpdateAgentIdentity < Reports::UpdateIdentity
|
||||||
attr_reader :agent
|
attr_reader :agent
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Reports::UpdateIdentity
|
class Reports::UpdateIdentity
|
||||||
|
|
||||||
attr_reader :account, :identity
|
attr_reader :account, :identity
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Webhooks::Chargebee
|
class Webhooks::Chargebee
|
||||||
|
|
||||||
SUPPORTED_EVENTS = [:subscription_created, :subscription_trial_end_reminder,
|
SUPPORTED_EVENTS = [:subscription_created, :subscription_trial_end_reminder,
|
||||||
|
|||||||
Reference in New Issue
Block a user