Skip to content

Commit

Permalink
Support ActiveRecord 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan authored and amarshall committed Feb 9, 2019
1 parent 2bf766a commit 0efbeb9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Expand Up @@ -4,3 +4,6 @@ inherit_gem:

AllCops:
TargetRubyVersion: 2.3

Lint/MissingCopEnableDirective:
Enabled: false
5 changes: 5 additions & 0 deletions .travis.yml
Expand Up @@ -13,6 +13,7 @@ install:

env:
- ACTIVE_RECORD_BRANCH="master"
- ACTIVE_RECORD_VERSION="~> 6.0.0.beta1"
- ACTIVE_RECORD_VERSION="~> 5.2.0"
- ACTIVE_RECORD_VERSION="~> 5.1.0"
- ACTIVE_RECORD_VERSION="~> 5.0.0"
Expand All @@ -27,6 +28,10 @@ matrix:
env: ACTIVE_RECORD_BRANCH="master"
- rvm: 2.4.5
env: ACTIVE_RECORD_BRANCH="master"
- rvm: 2.3.8
env: ACTIVE_RECORD_VERSION="~> 6.0.0.beta1"
- rvm: 2.4.5
env: ACTIVE_RECORD_VERSION="~> 6.0.0.beta1"
- rvm: jruby-9.2.5.0
env: ACTIVE_RECORD_VERSION="~> 4.2.0"

Expand Down
11 changes: 10 additions & 1 deletion Gemfile
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# rubocop:disable Bundler/DuplicatedGem, Bundler/OrderedGems

source 'https://rubygems.org'

gemspec
Expand All @@ -8,10 +10,17 @@ gem 'lint-config-ruby', git: 'https://github.com/Casecommons/lint-config-ruby.gi

ar_branch = ENV['ACTIVE_RECORD_BRANCH']
ar_version = ENV['ACTIVE_RECORD_VERSION']
is_jruby = RUBY_PLATFORM == 'java'

if ar_branch
gem 'activerecord', git: 'https://github.com/rails/rails.git', branch: ar_branch
gem 'arel', git: 'https://github.com/rails/arel.git' if ar_branch == 'master'
if ar_branch == 'master'
gem 'arel', git: 'https://github.com/rails/arel.git'
gem 'activerecord-jdbcsqlite3-adapter', git: 'https://github.com/jruby/activerecord-jdbc-adapter.git' if is_jruby
end
elsif ar_version
gem 'activerecord', ar_version # rubocop:disable Bundler/DuplicatedGem
if is_jruby && Gem::Requirement.new(ar_version).satisfied_by?(Gem::Version.new('6.0.0'))
gem 'activerecord-jdbcsqlite3-adapter', git: 'https://github.com/jruby/activerecord-jdbc-adapter.git'
end
end
4 changes: 2 additions & 2 deletions with_model.gemspec
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '>= 2.3'

spec.add_dependency 'activerecord', '>= 4.2', '< 6.0'
spec.add_dependency 'activerecord', '>= 4.2', '< 6.1'

spec.add_development_dependency 'bundler', '>= 1.0', '< 3.0'
spec.add_development_dependency 'minitest'
Expand All @@ -30,6 +30,6 @@ Gem::Specification.new do |spec|
if RUBY_PLATFORM == 'java'
spec.add_development_dependency 'activerecord-jdbcsqlite3-adapter'
else
spec.add_development_dependency 'sqlite3'
spec.add_development_dependency 'sqlite3', '~> 1.3.6'
end
end

0 comments on commit 0efbeb9

Please sign in to comment.