From d9474bdc499dfd52467a8e34d51847c33a509139 Mon Sep 17 00:00:00 2001 From: Jared Beck Date: Mon, 14 Dec 2020 16:03:52 -0500 Subject: [PATCH] Tests: Explicitly specify rails as a dev. dependency spec/dummy_app needs rails. Technically, it only needs actionpack, but in case that changes in the future, I think we should just have rails as an explicit dependency. You may ask, if dummy_app has always needed actionpack, and our gemspec didn't explicitly specify the later, how did it ever work? It looks like we were getting actionpack as a transitive dependency. --- Appraisals | 7 ++++--- gemfiles/ar_5.2.gemfile | 2 +- gemfiles/ar_6.0.gemfile | 2 +- paper_trail.gemspec | 8 +++++++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Appraisals b/Appraisals index 2622668c..17762f0a 100644 --- a/Appraisals +++ b/Appraisals @@ -8,13 +8,14 @@ # > appraisal. If something is specified in both the Gemfile and an appraisal, # > the version from the appraisal takes precedence. # > https://github.com/thoughtbot/appraisal - +# +# appraise "ar-5.2" do - gem "activerecord", "~> 5.2.4" + gem "rails", "~> 5.2.4" gem "rails-controller-testing", "~> 1.0.2" end appraise "ar-6.0" do - gem "activerecord", "~> 6.0.3" + gem "rails", "~> 6.0.3" gem "rails-controller-testing", "~> 1.0.3" end diff --git a/gemfiles/ar_5.2.gemfile b/gemfiles/ar_5.2.gemfile index a34a25f2..4fd4d624 100644 --- a/gemfiles/ar_5.2.gemfile +++ b/gemfiles/ar_5.2.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "activerecord", "~> 5.2.4" +gem "rails", "~> 5.2.4" gem "rails-controller-testing", "~> 1.0.2" gemspec path: "../" diff --git a/gemfiles/ar_6.0.gemfile b/gemfiles/ar_6.0.gemfile index 9e94f4f3..9cfa16c9 100644 --- a/gemfiles/ar_6.0.gemfile +++ b/gemfiles/ar_6.0.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "activerecord", "~> 6.0.3" +gem "rails", "~> 6.0.3" gem "rails-controller-testing", "~> 1.0.3" gemspec path: "../" diff --git a/paper_trail.gemspec b/paper_trail.gemspec index 78b8b2ee..05506707 100644 --- a/paper_trail.gemspec +++ b/paper_trail.gemspec @@ -31,7 +31,7 @@ has been destroyed. # https://www.ruby-lang.org/en/news/2019/10/02/ruby-2-4-9-released/ s.required_ruby_version = ">= 2.4.0" - # We no longer specify a maximum rails version. + # We no longer specify a maximum activerecord version. # See discussion in paper_trail/compatibility.rb s.add_dependency "activerecord", ::PaperTrail::Compatibility::ACTIVERECORD_GTE s.add_dependency "request_store", "~> 1.1" @@ -41,6 +41,12 @@ has been destroyed. s.add_development_dependency "ffaker", "~> 2.11" s.add_development_dependency "generator_spec", "~> 0.9.4" s.add_development_dependency "memory_profiler", "~> 0.9.14" + + # For `spec/dummy_app`. Technically, we only need `actionpack` (as of 2020). + # However, that might change in the future, and the advantages of specifying a + # subset (e.g. actionpack only) are unclear. + s.add_development_dependency "rails", ::PaperTrail::Compatibility::ACTIVERECORD_GTE + s.add_development_dependency "rake", "~> 13.0" s.add_development_dependency "rspec-rails", "~> 4.0" s.add_development_dependency "rubocop", "~> 0.89.1"