From d63a5b3fb045f0ca3f3c624f26f815e8168f54fe Mon Sep 17 00:00:00 2001 From: kvokka Date: Thu, 10 Dec 2020 05:40:13 +0000 Subject: [PATCH] Add Rails 6.1 support --- .travis.yml | 5 +++++ Appraisals | 6 +++++- acts-as-taggable-on.gemspec | 3 ++- gemfiles/activerecord_6.0.gemfile | 2 +- gemfiles/activerecord_6.1.gemfile | 23 +++++++++++++++++++++++ lib/acts-as-taggable-on.rb | 2 +- 6 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 gemfiles/activerecord_6.1.gemfile diff --git a/.travis.yml b/.travis.yml index f3b817f7a..385b5efe3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,7 @@ gemfile: - gemfiles/activerecord_5.1.gemfile - gemfiles/activerecord_5.0.gemfile - gemfiles/activerecord_6.0.gemfile + - gemfiles/activerecord_6.1.gemfile bundler_args: '--without local_development --jobs 3 --retry 3' @@ -42,3 +43,7 @@ matrix: gemfile: gemfiles/activerecord_6.0.gemfile - rvm: 2.4.6 gemfile: gemfiles/activerecord_6.0.gemfile + - rvm: 2.3.7 + gemfile: gemfiles/activerecord_6.1.gemfile + - rvm: 2.4.6 + gemfile: gemfiles/activerecord_6.1.gemfile diff --git a/Appraisals b/Appraisals index 317a3b25a..7a46ac675 100644 --- a/Appraisals +++ b/Appraisals @@ -11,5 +11,9 @@ appraise 'activerecord-5.0' do end appraise 'activerecord-6.0' do - gem 'activerecord', "~> 6.0.0.beta1" + gem 'activerecord', "~> 6.0.0" +end + +appraise 'activerecord-6.1' do + gem 'activerecord', "~> 6.1.0" end diff --git a/acts-as-taggable-on.gemspec b/acts-as-taggable-on.gemspec index e88cbe9b8..f0c7f5fe1 100644 --- a/acts-as-taggable-on.gemspec +++ b/acts-as-taggable-on.gemspec @@ -22,11 +22,12 @@ Gem::Specification.new do |gem| gem.post_install_message = File.read('UPGRADING.md') end - gem.add_runtime_dependency 'activerecord', '>= 5.0', '< 6.1' + gem.add_runtime_dependency 'activerecord', '>= 5.0', '< 6.2' gem.add_development_dependency 'rspec-rails' gem.add_development_dependency 'rspec-its' gem.add_development_dependency 'rspec' gem.add_development_dependency 'barrier' gem.add_development_dependency 'database_cleaner' + gem.add_development_dependency 'sqlite3' end diff --git a/gemfiles/activerecord_6.0.gemfile b/gemfiles/activerecord_6.0.gemfile index 6f78ffcf9..0241668f7 100644 --- a/gemfiles/activerecord_6.0.gemfile +++ b/gemfiles/activerecord_6.0.gemfile @@ -5,7 +5,7 @@ case ENV["DB"] when "postgresql" gem 'pg' when "mysql" - gem 'mysql2', '~> 0.3' + gem 'mysql2', '~> 0.4' else gem 'sqlite3' end diff --git a/gemfiles/activerecord_6.1.gemfile b/gemfiles/activerecord_6.1.gemfile new file mode 100644 index 000000000..a4c696f23 --- /dev/null +++ b/gemfiles/activerecord_6.1.gemfile @@ -0,0 +1,23 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activerecord", "~> 6.1.0" +case ENV["DB"] +when "postgresql" + gem 'pg' +when "mysql" + gem 'mysql2', '~> 0.5' +else + gem 'sqlite3' +end + +group :local_development do + gem "guard" + gem "guard-rspec" + gem "appraisal" + gem "rake" + gem "byebug", platforms: [:mri] +end + +gemspec path: "../" diff --git a/lib/acts-as-taggable-on.rb b/lib/acts-as-taggable-on.rb index 3e6a6d9d3..4922a181c 100644 --- a/lib/acts-as-taggable-on.rb +++ b/lib/acts-as-taggable-on.rb @@ -58,7 +58,7 @@ def self.respond_to?(method_name, include_private=false) def self.glue setting = @configuration.delimiter delimiter = setting.kind_of?(Array) ? setting[0] : setting - delimiter.ends_with?(' ') ? delimiter : "#{delimiter} " + delimiter.end_with?(' ') ? delimiter : "#{delimiter} " end class Configuration