Skip to content

Commit

Permalink
v2.4.0 -- add note about required migration, bump version, update REA…
Browse files Browse the repository at this point in the history
…DME and Changelog
  • Loading branch information
mathieujobin committed May 2, 2022
1 parent c204021 commit 425d23f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## [v2.4.0](https://github.com/payrollhero/webhook_system/tree/v2.4.0) (2022-05-02)
[Full Changelog](https://github.com/payrollhero/webhook_system/compare/v2.3.1...v2.4.0)

* Rails 7.0 Official support.
* Please read Upgrade notes, a migration is required to rename encrypt column to encrypted.

## [v2.3.1](https://github.com/payrollhero/webhook_system/tree/v2.3.1) (2022-04-27)
[Full Changelog](https://github.com/payrollhero/webhook_system/compare/v2.3.0...v2.3.1)

Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ Few Main points ..
4. The webhook is delivered to the recipient as a JSON payload with a base64 encoded data component
5. The recipient is meant to use their copy of this secret to decode that payload, and then action it as needed.

## Upgrading

If you are upgrading from <= 2.3.1 into >= 2.4, then you must run a migration to rename the `encrypt` column.
This rename was required for adding support for Rails 7.

You can use this migration.

```ruby
# db/migrate/20220427113942_rename_encrypt_on_webhook_subscriptions.rb
class RenameEncryptOnWebhookSubscriptions < ActiveRecord::Migration[7.0]
def change
rename_column :webhook_subscriptions, :encrypt, :encrypted
end
end
```

## Setup

The webhook integration code runs on two tables. You need to create a new migration that adds these
Expand All @@ -30,7 +46,7 @@ tables first:
create_table :webhook_subscriptions do |t|
t.string :url, null: false
t.boolean :active, null: false, index: true
t.boolean :encrypt, null: false, default: false
t.boolean :encrypted, null: false, default: false
t.text :secret
end

Expand Down
2 changes: 1 addition & 1 deletion lib/webhook_system/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module WebhookSystem
VERSION = '2.3.1'
VERSION = '2.4.0'
end
18 changes: 18 additions & 0 deletions webhook_system.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@ Gem::Specification.new do |gem|
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
gem.require_paths = ['lib']

gem.post_install_message = %q{
## Upgrading
If you are upgrading from <= 2.3.1 into >= 2.4, then you must run a migration to rename the `encrypt` column.
This rename was required for adding support for Rails 7.
You can use this migration.
```ruby
# db/migrate/20220427113942_rename_encrypt_on_webhook_subscriptions.rb
class RenameEncryptOnWebhookSubscriptions < ActiveRecord::Migration[7.0]
def change
rename_column :webhook_subscriptions, :encrypt, :encrypted
end
end
```
}

gem.add_runtime_dependency 'activesupport', '> 4.2', '< 7.1'
gem.add_runtime_dependency 'activerecord', '> 4.2', '< 7.1'
gem.add_runtime_dependency 'activejob', '> 4.2', '< 7.1'
Expand Down

0 comments on commit 425d23f

Please sign in to comment.