Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(perf): Add missing frozen_string_literal comment #2251

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ AllCops:
Style/StringLiterals:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: true

Performance/CaseWhenSplat:
Enabled: true

Expand Down
2 changes: 2 additions & 0 deletions app/jobs/data_exports/export_resources_job.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module DataExports
class ExportResourcesJob < ApplicationJob
queue_as :default
Expand Down
2 changes: 2 additions & 0 deletions app/mailers/data_export_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class DataExportMailer < ApplicationMailer
def completed
@data_export = params[:data_export]
Expand Down
2 changes: 2 additions & 0 deletions app/models/data_export.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class DataExport < ApplicationRecord
EXPORT_FORMATS = %w[csv].freeze
STATUSES = %w[pending processing completed failed].freeze
Expand Down
2 changes: 2 additions & 0 deletions app/models/integration_resource.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class IntegrationResource < ApplicationRecord
belongs_to :syncable, polymorphic: true
belongs_to :integration, class_name: 'Integrations::BaseIntegration'
Expand Down
2 changes: 2 additions & 0 deletions app/services/data_exports/create_service.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module DataExports
class CreateService < BaseService
def initialize(organization:, user:, format:, resource_type:, resource_query:)
Expand Down
2 changes: 2 additions & 0 deletions app/services/data_exports/export_resources_service.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module DataExports
class ExportResourcesService < BaseService
def call
Expand Down
2 changes: 2 additions & 0 deletions db/clickhouse_migrate/20231024084411_create_events_raw.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class CreateEventsRaw < ActiveRecord::Migration[7.0]
def change
options = <<-SQL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class AddSignatureToWebhookEndpoints < ActiveRecord::Migration[7.0]
def change
add_column :webhook_endpoints, :signature_algo, :integer, default: 0, null: false # 0 is JWT
Expand Down
2 changes: 2 additions & 0 deletions db/migrate/20240514081110_create_integration_resources.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class CreateIntegrationResources < ActiveRecord::Migration[7.0]
def change
create_table :integration_resources, id: :uuid do |t|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class AddIntegrationIdToIntegrationResources < ActiveRecord::Migration[7.0]
def up
remove_index :integration_items, [:external_id, :integration_id]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class AddResourceTypeToIntegrationResources < ActiveRecord::Migration[7.0]
def change
add_column :integration_resources, :resource_type, :integer, null: false, default: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class AddInAdvanceChargePeriodicInvoicingReason < ActiveRecord::Migration[7.0]
def up
execute <<-SQL
Expand Down
2 changes: 2 additions & 0 deletions db/migrate/20240625090742_create_data_exports.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class CreateDataExports < ActiveRecord::Migration[7.0]
def change
create_table :data_exports, id: :uuid do |t|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class AddMembershipIdAndOrganizationIdToDataExports < ActiveRecord::Migration[7.1]
def change
add_reference :data_exports, :membership, foreign_key: true, type: :uuid
Expand Down
2 changes: 2 additions & 0 deletions db/migrate/20240628083830_remove_user_id_from_data_exports.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class RemoveUserIdFromDataExports < ActiveRecord::Migration[7.1]
def change
remove_reference :data_exports, :user, null: false, foreign_key: true, type: :uuid
Expand Down
2 changes: 2 additions & 0 deletions db/migrate/20240702081109_add_regroup_paid_fees_to_charges.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class AddRegroupPaidFeesToCharges < ActiveRecord::Migration[7.1]
def change
add_column :charges, :regroup_paid_fees, :integer, default: nil
Expand Down
2 changes: 2 additions & 0 deletions spec/factories/data_exports.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

FactoryBot.define do
factory :data_export do
organization
Expand Down
2 changes: 2 additions & 0 deletions spec/factories/integration_resources.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

FactoryBot.define do
factory :integration_resource do
association :syncable, factory: %i[invoice payment credit_note].sample
Expand Down
2 changes: 2 additions & 0 deletions spec/jobs/data_exports/export_resources_job_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe DataExports::ExportResourcesJob, type: :job do
Expand Down
2 changes: 2 additions & 0 deletions spec/mailers/data_export_mailer_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe DataExportMailer, type: :mailer do
Expand Down
2 changes: 2 additions & 0 deletions spec/mailers/previews/base_preview_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class BasePreviewMailer < ActionMailer::Preview
def self.call(...)
message = nil
Expand Down
2 changes: 2 additions & 0 deletions spec/mailers/previews/data_export_mailer_preview.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class DataExportMailerPreview < BasePreviewMailer
def completed
data_export = FactoryBot.create :data_export, :completed
Expand Down
2 changes: 2 additions & 0 deletions spec/models/data_export_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe DataExport, type: :model do
Expand Down
2 changes: 2 additions & 0 deletions spec/models/integration_resource_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe IntegrationResource, type: :model do
Expand Down
2 changes: 2 additions & 0 deletions spec/services/data_exports/create_service_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe DataExports::CreateService, type: :service do
Expand Down
2 changes: 2 additions & 0 deletions spec/services/data_exports/export_resources_service_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe DataExports::ExportResourcesService, type: :service do
Expand Down