From 3b8f55b3d13e2af5aa0aa5ceaf373aa16c06c12d Mon Sep 17 00:00:00 2001 From: Joey Tepperman Date: Wed, 9 Mar 2022 17:09:46 -0500 Subject: [PATCH] Fix `create_versions` migration to support Ruby3 (#1366) * Fix `create_versions` migration to support Ruby3 * Update changelog --- CHANGELOG.md | 3 ++- lib/generators/paper_trail/install/install_generator.rb | 4 ++-- spec/generators/paper_trail/install_generator_spec.rb | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be3b4fd4..677c6898 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,8 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/). ### Fixed -- None +- [#1366](https://github.com/paper-trail-gem/paper_trail/pull/1366) - + Fixed a bug where the `create_versions` migration lead to a broken `db/schema.rb` for Ruby 3 ### Dependencies diff --git a/lib/generators/paper_trail/install/install_generator.rb b/lib/generators/paper_trail/install/install_generator.rb index 4fa90364..13786636 100644 --- a/lib/generators/paper_trail/install/install_generator.rb +++ b/lib/generators/paper_trail/install/install_generator.rb @@ -53,9 +53,9 @@ module PaperTrail # See https://github.com/paper-trail-gem/paper_trail/issues/651 def item_type_options if mysql? - ", { null: false, limit: 191 }" + ", null: false, limit: 191" else - ", { null: false }" + ", null: false" end end diff --git a/spec/generators/paper_trail/install_generator_spec.rb b/spec/generators/paper_trail/install_generator_spec.rb index 9fccc48b..34f1386c 100644 --- a/spec/generators/paper_trail/install_generator_spec.rb +++ b/spec/generators/paper_trail/install_generator_spec.rb @@ -33,9 +33,9 @@ RSpec.describe PaperTrail::InstallGenerator, type: :generator do }.call expected_item_type_options = lambda { if described_class::MYSQL_ADAPTERS.include?(ActiveRecord::Base.connection.class.name) - ", { null: false, limit: 191 }" + ", null: false, limit: 191" else - ", { null: false }" + ", null: false" end }.call expect(destination_root).to(