lib/table_sync/model/sequel.rb in table_sync-1.11.0 vs lib/table_sync/model/sequel.rb in table_sync-1.12.0
- old
+ new
@@ -34,18 +34,19 @@
update: upd_spec,
update_where: version_condition,
)
.multi_insert(insert_data)
- TableSync::Instrument.notify table: table_name, count: result.count,
- event: :update, direction: :receive
+ TableSync::Instrument.notify table: model_naming.table, schema: model_naming.schema,
+ count: result.count, event: :update, direction: :receive
result
end
def destroy(data)
result = dataset.returning.where(data).delete
- TableSync::Instrument.notify table: table_name, count: result.count,
+ TableSync::Instrument.notify table: model_naming.table, schema: model_naming.schema,
+ count: result.count,
event: :destroy, direction: :receive
result
end
def transaction(&block)
@@ -60,9 +61,13 @@
attr_reader :raw_model
def table_name
raw_model.table_name
+ end
+
+ def model_naming
+ ::TableSync::NamingResolver::Sequel.new(table_name: table_name, db: db)
end
def dataset
raw_model.dataset
end