From 1de699dde7cd96ca372d1bb06cd90fe180c86ddb Mon Sep 17 00:00:00 2001 From: Daria Mayorova Date: Wed, 18 Sep 2024 16:02:26 +0200 Subject: [PATCH] Small tweaks --- app/lib/event_store/active_record_event_repository.rb | 2 +- app/lib/three_scale/hash_hacks.rb | 8 ++++---- app/services/finance/billing_service.rb | 1 - features/step_definitions/legal_terms_steps.rb | 2 +- test/factories/cms.rb | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/lib/event_store/active_record_event_repository.rb b/app/lib/event_store/active_record_event_repository.rb index 5a0bf7f06f..46a9657d7d 100644 --- a/app/lib/event_store/active_record_event_repository.rb +++ b/app/lib/event_store/active_record_event_repository.rb @@ -5,7 +5,7 @@ class ActiveRecordEventRepository < RailsEventStoreActiveRecord::EventRepository def build_event_entity(record) return nil unless record - data = (record.data || {}).merge( + data = record.data.merge( event_id: record.event_id, metadata: record.metadata ) diff --git a/app/lib/three_scale/hash_hacks.rb b/app/lib/three_scale/hash_hacks.rb index e381046fcd..9c9ab5f161 100644 --- a/app/lib/three_scale/hash_hacks.rb +++ b/app/lib/three_scale/hash_hacks.rb @@ -24,22 +24,22 @@ def sweep # Convert all keys to lowercase. def downcase_keys - transform_keys { |key| key.downcase } + transform_keys(&:downcase) end # In place version of +downcase_keys+ def downcase_keys! - transform_keys! {|key| key.downcase} + transform_keys!(&:downcase) end # Convert all keys to uppercase. def upcase_keys - transform_keys { |key| key.upcase } + transform_keys(&:upcase) end # In place version of +upcase_keys+ def upcase_keys! - transform_keys! { |key| key.upcase } + transform_keys!(&:upcase) end end end diff --git a/app/services/finance/billing_service.rb b/app/services/finance/billing_service.rb index 0cc1af27c1..c3f94bdc25 100644 --- a/app/services/finance/billing_service.rb +++ b/app/services/finance/billing_service.rb @@ -73,7 +73,6 @@ def with_lock def report_error(error) message = "Failed to perform billing job: #{error.message}" - Rails.logger.error(message) System::ErrorReporting.report_error(error, error_message: message, error_class: error.class.name) end diff --git a/features/step_definitions/legal_terms_steps.rb b/features/step_definitions/legal_terms_steps.rb index 2ebe68c0e0..595121f7ce 100644 --- a/features/step_definitions/legal_terms_steps.rb +++ b/features/step_definitions/legal_terms_steps.rb @@ -6,5 +6,5 @@ Given "{provider} has service subscription legal terms:" do |provider, text| provider.builtin_legal_terms.create!(system_name: CMS::Builtin::LegalTerm::SUBSCRIPTION_SYSTEM_NAME, - published: text) + draft: text) end diff --git a/test/factories/cms.rb b/test/factories/cms.rb index 22661bb430..0c3a56f553 100644 --- a/test/factories/cms.rb +++ b/test/factories/cms.rb @@ -82,6 +82,6 @@ factory :cms_builtin_legal_term, :parent => :cms_builtin_partial, :class => CMS::Builtin::LegalTerm do system_name { 'signup_licence' } sequence(:title) { |n| "Legal Term ##{n}" } - published { "some text" } + draft { "some text" } end end