Skip to content

Commit

Permalink
fix: support proto_payload attr for backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
bibendi committed Feb 29, 2024
1 parent 209ddf5 commit 2f7e5ec
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased] - yyyy-mm-dd

## [5.0.1] - 2024-02-29

### Fixed

- fixed backward compatibility with proto_payload

## [5.0.0] - 2024-02-27

### Added

- track errors when the worker get a failure
Expand Down
16 changes: 16 additions & 0 deletions app/models/sbmt/outbox/base_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ def bucket_partitions
self.uuid ||= SecureRandom.uuid if has_attribute?(:uuid)
end

def proto_payload
if has_attribute?(:payload)
payload
else
self[:proto_payload]
end
end

def proto_payload=(value)
if has_attribute?(:payload)
self.payload = value
else
self[:proto_payload] = value
end
end

def payload
if has_attribute?(:proto_payload)
proto_payload
Expand Down
2 changes: 1 addition & 1 deletion lib/sbmt/outbox/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Sbmt
module Outbox
VERSION = "5.0.0"
VERSION = "5.0.1"
end
end

0 comments on commit 2f7e5ec

Please sign in to comment.