Skip to content

Commit

Permalink
Fix deprecated link_to_stream.
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlyobvious committed Jul 17, 2018
1 parent bc1490f commit 37df713
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ruby_event_store/lib/ruby_event_store/link_by_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(event_store:, key:, prefix: nil)
def call(event)
return unless event.metadata.has_key?(@key)

@event_store.link_to_stream(
@event_store.link(
[event.message_id],
stream_name: "#{@prefix}#{event.metadata.fetch(@key)}"
)
Expand Down Expand Up @@ -45,7 +45,7 @@ def initialize(event_store:, prefix: nil)
end

def call(event)
@event_store.link_to_stream(
@event_store.link(
[event.message_id],
stream_name: "#{@prefix}#{event.type}"
)
Expand Down
4 changes: 2 additions & 2 deletions ruby_event_store/spec/link_by_metadata_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module RubyEventStore

specify "explicitly passes array of ids instead of a single id" do
event_store.subscribe_to_all_events(LinkByMetadata.new(event_store: event_store, key: :city))
expect(event_store).to receive(:link_to_stream).with(instance_of(Array), any_args)
expect(event_store).to receive(:link).with(instance_of(Array), any_args)
event_store.publish(ev = OrderCreated.new(metadata:{
city: "Paris",
}))
Expand Down Expand Up @@ -138,7 +138,7 @@ module RubyEventStore

specify "explicitly passes array of ids instead of a single id" do
event_store.subscribe_to_all_events(LinkByEventType.new(event_store: event_store))
expect(event_store).to receive(:link_to_stream).with(instance_of(Array), any_args)
expect(event_store).to receive(:link).with(instance_of(Array), any_args)
event_store.publish(ev = OrderCreated.new())
end
end
Expand Down

0 comments on commit 37df713

Please sign in to comment.