Skip to content

Commit

Permalink
Fix: ActiveRecordConsumer batch consumption was not working with the …
Browse files Browse the repository at this point in the history
…trilogy adapter.
  • Loading branch information
dorner committed Mar 26, 2024
1 parent e93753d commit 7c2c9bb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## UNRELEASED

# 1.24.1 - 2024-03-26
- Fix: ActiveRecordConsumer batch consumption was not working with the trilogy adapter.

# 1.24.0 - 2024-02-26

***BREAKING CHANGE****
Expand Down
1 change: 1 addition & 0 deletions deimos-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency('sigurd', '>= 0.1.0', '< 1.0')

spec.add_development_dependency('activerecord-import')
spec.add_development_dependency('activerecord-trilogy-adapter', '> 0')
spec.add_development_dependency('avro', '~> 1.9')
spec.add_development_dependency('database_cleaner', '~> 1.7')
spec.add_development_dependency('ddtrace', '>= 0.11')
Expand Down
3 changes: 2 additions & 1 deletion lib/deimos/active_record_consume/mass_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def save_records_to_database(record_list)

options = if @key_cols.empty?
{} # Can't upsert with no key, just do regular insert
elsif ActiveRecord::Base.connection.adapter_name.downcase =~ /mysql/
elsif ActiveRecord::Base.connection.adapter_name.downcase =~ /mysql/ ||
ActiveRecord::Base.connection.adapter_name.downcase =~ /trilogy/
{
on_duplicate_key_update: columns
}
Expand Down
2 changes: 1 addition & 1 deletion lib/deimos/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Deimos
VERSION = '1.24.0'
VERSION = '1.24.1'
end
7 changes: 7 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ def build_message(payload, topic, key)
database: 'test',
host: ENV['MYSQL_HOST'] || '127.0.0.1'
},
{
adapter: 'trilogy',
port: 3306,
username: 'root',
database: 'test',
host: ENV['MYSQL_HOST'] || '127.0.0.1'
},
{
adapter: 'sqlite3',
database: 'test.sqlite3'
Expand Down

0 comments on commit 7c2c9bb

Please sign in to comment.