Skip to content

Commit 80c0fa0

Browse files
committed
Fix autloading issue, ensure the mapper is created.
1 parent 7ff88f6 commit 80c0fa0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

infra/lib/infra/event_store.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class EventStore < SimpleDelegator
33
def self.main
44
require_relative "../../../rails_application/lib/transformations/refund_to_return_event_mapper" rescue nil
55

6-
if defined?(Transformations::RefundToReturnEventMapper)
6+
begin
77
mapper = RubyEventStore::Mappers::PipelineMapper.new(
88
RubyEventStore::Mappers::Pipeline.new(
99
Transformations::RefundToReturnEventMapper.new(
@@ -17,7 +17,8 @@ def self.main
1717
)
1818
)
1919
client = RailsEventStore::JSONClient.new(mapper: mapper)
20-
else
20+
rescue => e
21+
puts "Mapper creation failed: #{e.message}"
2122
client = RailsEventStore::JSONClient.new
2223
end
2324

0 commit comments

Comments
 (0)