Skip to content

Commit

Permalink
Merge pull request #1013 from kvokka/add-rails-6-1-support
Browse files Browse the repository at this point in the history
Add Rails 6.1 support
  • Loading branch information
seuros authored Dec 17, 2020
2 parents 47da503 + 37bfebc commit 06bf141
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 6 deletions.
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

0 comments on commit 06bf141

Please sign in to comment.