diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a11902..4a52fac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/README.md b/README.md index 9890752..39e0370 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/lib/webhook_system/version.rb b/lib/webhook_system/version.rb index 100854d..ea04c00 100644 --- a/lib/webhook_system/version.rb +++ b/lib/webhook_system/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module WebhookSystem - VERSION = '2.3.1' + VERSION = '2.4.0' end diff --git a/webhook_system.gemspec b/webhook_system.gemspec index 6f901a7..be7a153 100644 --- a/webhook_system.gemspec +++ b/webhook_system.gemspec @@ -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'