Skip to content

Commit

Permalink
Set table_name and schema_name as required for TableSync::Publishing:…
Browse files Browse the repository at this point in the history
…:Raw
  • Loading branch information
AS-AlStar committed Dec 9, 2024
1 parent ddfe667 commit 9a94f10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/table_sync/publishing/raw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TableSync::Publishing::Raw

attribute :event, default: :update

require_attributes :model_name, :original_attributes
require_attributes :model_name, :original_attributes, :table_name, :schema_name

def publish_now
message.publish
Expand Down
8 changes: 5 additions & 3 deletions spec/publishing/raw_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
let(:expected_routing_key) { "custom_routing_key" }
let(:headers) { { some_key: "123" } }
let(:original_attributes) { [{ id: 1, name: "purum" }] }
let(:table_name) { "sequel_users" }
let(:schema_name) { "public" }

let(:attributes) do
{
Expand All @@ -16,8 +18,8 @@
routing_key:,
headers:,
event:,
table_name: nil,
schema_name: nil,
table_name:,
schema_name:,
custom_version: nil,
}
end
Expand All @@ -40,5 +42,5 @@

include_examples "publisher#new without expected fields",
TableSync::Publishing::Raw,
%i[model_name original_attributes]
%i[model_name original_attributes table_name schema_name]
end

0 comments on commit 9a94f10

Please sign in to comment.