Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rails 6.1 support #1013

Merged
merged 1 commit into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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
6 changes: 5 additions & 1 deletion Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion acts-as-taggable-on.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/activerecord_6.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions gemfiles/activerecord_6.1.gemfile
Original file line number Diff line number Diff line change
@@ -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: "../"
2 changes: 1 addition & 1 deletion lib/acts-as-taggable-on.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/acts_as_taggable_on/tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/support/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down