Skip to content

Commit

Permalink
Merge pull request #17 from tagliala/feature/rails-61
Browse files Browse the repository at this point in the history
Add Rails 6.1 compatibility
  • Loading branch information
tagliala committed May 19, 2021
2 parents 4f55d76 + 2846ddd commit ff85ab5
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Expand Up @@ -22,6 +22,7 @@ gemfile:
- gemfiles/rails_5.1.gemfile
- gemfiles/rails_5.2.gemfile
- gemfiles/rails_6.0.gemfile
- gemfiles/rails_6.1.gemfile

jobs:
exclude:
Expand All @@ -33,16 +34,22 @@ jobs:
gemfile: gemfiles/rails_5.2.gemfile
- rvm: 2.1.10
gemfile: gemfiles/rails_6.0.gemfile
- rvm: 2.1.10
gemfile: gemfiles/rails_6.1.gemfile

- rvm: 2.2.10
gemfile: gemfiles/rails_6.0.gemfile
- rvm: 2.2.10
gemfile: gemfiles/rails_6.1.gemfile

- rvm: 2.3.8
gemfile: gemfiles/rails_4.0.gemfile
- rvm: 2.3.8
gemfile: gemfiles/rails_4.1.gemfile
- rvm: 2.3.8
gemfile: gemfiles/rails_6.0.gemfile
- rvm: 2.3.8
gemfile: gemfiles/rails_6.1.gemfile

- rvm: 2.4.10
gemfile: gemfiles/rails_3.2.gemfile
Expand All @@ -52,6 +59,8 @@ jobs:
gemfile: gemfiles/rails_4.1.gemfile
- rvm: 2.4.10
gemfile: gemfiles/rails_6.0.gemfile
- rvm: 2.4.10
gemfile: gemfiles/rails_6.1.gemfile

- rvm: 2.5.9
gemfile: gemfiles/rails_3.2.gemfile
Expand Down
4 changes: 4 additions & 0 deletions Appraisals
Expand Up @@ -38,3 +38,7 @@ end
appraise 'rails-6.0' do
gem 'rails', '~> 6.0.0'
end

appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
end
7 changes: 7 additions & 0 deletions gemfiles/rails_6.1.gemfile
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 6.1.0"

gemspec path: "../"
1 change: 1 addition & 0 deletions lib/eaco/adapters/active_record/compatibility.rb
Expand Up @@ -14,6 +14,7 @@ class Compatibility
autoload :V51, 'eaco/adapters/active_record/compatibility/v51.rb'
autoload :V52, 'eaco/adapters/active_record/compatibility/v52.rb'
autoload :V60, 'eaco/adapters/active_record/compatibility/v60.rb'
autoload :V61, 'eaco/adapters/active_record/compatibility/v61.rb'

autoload :Scoped, 'eaco/adapters/active_record/compatibility/scoped.rb'
autoload :Sanitized, 'eaco/adapters/active_record/compatibility/sanitized.rb'
Expand Down
30 changes: 30 additions & 0 deletions lib/eaco/adapters/active_record/compatibility/v61.rb
@@ -0,0 +1,30 @@
module Eaco
module Adapters
module ActiveRecord
class Compatibility

##
# Rails 6.1 support module.
#
# JSONB works correctly, but we need +.scoped+ so we revive it through
# the {Scoped} support module.
#
# @see Scoped
#
# Sanitize has dissapeared in favour of quote.
#
# @see Sanitized
#
module V61
extend ActiveSupport::Concern

included do
extend Scoped
extend Sanitized
end
end

end
end
end
end

0 comments on commit ff85ab5

Please sign in to comment.