From 2801f7502cbb54bc2a11d32cda340b94adcf420a Mon Sep 17 00:00:00 2001 From: Guillermo Aguirre Date: Wed, 20 Sep 2023 11:32:26 -0300 Subject: [PATCH] Order requirements alphabetically --- lib/active_outbox.rb | 4 ++-- lib/active_outbox/outboxable.rb | 2 +- spec/spec_helper.rb | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/active_outbox.rb b/lib/active_outbox.rb index 0df36d8..763626f 100644 --- a/lib/active_outbox.rb +++ b/lib/active_outbox.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true +require 'active_outbox/adapter_helper' require 'active_outbox/configuration' require 'active_outbox/errors' -require 'active_outbox/outboxable' -require 'active_outbox/adapter_helper' require 'active_outbox/generators/active_outbox_generator' +require 'active_outbox/outboxable' require 'active_outbox/railtie' if defined?(Rails::Railtie) diff --git a/lib/active_outbox/outboxable.rb b/lib/active_outbox/outboxable.rb index bd37122..32cf63f 100644 --- a/lib/active_outbox/outboxable.rb +++ b/lib/active_outbox/outboxable.rb @@ -39,7 +39,7 @@ def save!(**options, &block) def create_outbox!(action, event_name) unless self.class.module_parent.const_defined?('OUTBOX_MODEL') - *namespace, _ = self.class.name.underscore.upcase.split('/') + *namespace, _klass = self.class.name.underscore.upcase.split('/') namespace.reverse.join('.') outbox_model_name = ActiveOutbox.configuration.outbox_mapping[self.class.module_parent.name.underscore] || ActiveOutbox.configuration.outbox_mapping['default'] diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a693f6d..f891e70 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,11 +2,11 @@ ENV['RAILS_ENV'] ||= 'test' -require 'active_record' require 'active_outbox' +require 'active_record' require 'byebug' -require 'simplecov' require 'database_cleaner/active_record' +require 'simplecov' SimpleCov.start 'rails' do add_filter 'spec/' @@ -39,6 +39,7 @@ def self.name validates_presence_of :identifier, :payload, :aggregate, :aggregate_identifier, :event end + FakeModel = Class.new(ActiveRecord::Base) do def self.name 'FakeModel'