Skip to content

Commit

Permalink
Relax active record/support constraints to support Rails 6.
Browse files Browse the repository at this point in the history
  • Loading branch information
aclemons committed May 7, 2019
1 parent df0352b commit f76821b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ services:
- mongodb
- memcached
env:
- RAILS_VERSION=6.0.0.rc1 SQLITE3_VERSION=1.4.1
- RAILS_VERSION=5.2.3
- RAILS_VERSION=5.1.4
- RAILS_VERSION=5.0.0
- RAILS_VERSION=4.2.5
Expand All @@ -25,3 +27,13 @@ matrix:
env: RAILS_VERSION=5.0.0
- rvm: 2.1
env: RAILS_VERSION=5.1.4
- rvm: 2.1
env: RAILS_VERSION=5.2.3
- rvm: 2.1
env: RAILS_VERSION=6.0.0.rc1 SQLITE3_VERSION=1.4.1
- rvm: 2.2
env: RAILS_VERSION=6.0.0.rc1 SQLITE3_VERSION=1.4.1
- rvm: 2.3
env: RAILS_VERSION=6.0.0.rc1 SQLITE3_VERSION=1.4.1
- rvm: 2.4
env: RAILS_VERSION=6.0.0.rc1 SQLITE3_VERSION=1.4.1
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gem 'shotgun', '~> 0.9'
gem 'statsd-ruby', '~> 1.2.1'
gem 'rspec', '~> 3.0'
gem 'rack-test', '~> 0.6.3'
gem 'sqlite3', '~> 1.3.11'
gem 'sqlite3', "~> #{ENV['SQLITE3_VERSION'] || '1.3.11'}"
gem 'rails', "~> #{ENV['RAILS_VERSION'] || '5.1.4'}"
gem 'minitest', '~> 5.8.0'
gem 'rubocop', '~> 0.45.0'
Expand Down
2 changes: 1 addition & 1 deletion flipper-active_record.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ Gem::Specification.new do |gem|
gem.metadata = Flipper::METADATA

gem.add_dependency 'flipper', "~> #{Flipper::VERSION}"
gem.add_dependency 'activerecord', '>= 3.2', '< 6'
gem.add_dependency 'activerecord', '>= 3.2', '< 7'
end
2 changes: 1 addition & 1 deletion flipper-active_support_cache_store.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ Gem::Specification.new do |gem|
gem.metadata = Flipper::METADATA

gem.add_dependency 'flipper', "~> #{Flipper::VERSION}"
gem.add_dependency 'activesupport', '>= 3.2', '< 6'
gem.add_dependency 'activesupport', '>= 3.2', '< 7'
end
6 changes: 3 additions & 3 deletions lib/generators/flipper/active_record_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ def self.next_migration_number(dirname)
end

def self.migration_version
"[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" if rails5?
"[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" if requires_migration_number?
end

def self.rails5?
Rails.version.start_with?('5')
def self.requires_migration_number?
Rails::VERSION::MAJOR.to_i >= 5
end

def create_migration_file
Expand Down
9 changes: 9 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ bundle exec rake
export RAILS_VERSION=5.1.4
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=5.2.3
script/bootstrap || bundle update
bundle exec rake

export RAILS_VERSION=6.0.0.rc1
export SQLITE3_VERSION=1.4.1
script/bootstrap || bundle update
bundle exec rake

0 comments on commit f76821b

Please sign in to comment.