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..09ddeac86 100644 --- a/acts-as-taggable-on.gemspec +++ b/acts-as-taggable-on.gemspec @@ -22,7 +22,7 @@ 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' 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 diff --git a/lib/acts_as_taggable_on/tag.rb b/lib/acts_as_taggable_on/tag.rb index f1e0e3b3f..8e6c76537 100644 --- a/lib/acts_as_taggable_on/tag.rb +++ b/lib/acts_as_taggable_on/tag.rb @@ -10,7 +10,7 @@ class Tag < ::ActiveRecord::Base ### VALIDATIONS: validates_presence_of :name - validates_uniqueness_of :name, if: :validates_name_uniqueness? + validates_uniqueness_of :name, if: :validates_name_uniqueness?, case_sensitive: true validates_length_of :name, maximum: 255 # monkey patch this method if don't need name uniqueness validation diff --git a/spec/support/database.rb b/spec/support/database.rb index 7dc5e134c..9a2e162f3 100644 --- a/spec/support/database.rb +++ b/spec/support/database.rb @@ -10,7 +10,7 @@ ActiveRecord::Base.configurations = YAML.load_file(database_yml) ActiveRecord::Base.logger = Logger.new(File.join(File.dirname(__FILE__), '../debug.log')) ActiveRecord::Base.logger.level = ENV['TRAVIS'] ? ::Logger::ERROR : ::Logger::DEBUG - config = ActiveRecord::Base.configurations[db_name] + config = ActiveSupport::HashWithIndifferentAccess.new(ActiveRecord::Base.configurations[db_name]) begin ActiveRecord::Base.establish_connection(db_name.to_sym)