diff --git a/.travis.yml b/.travis.yml index aa9bb36..30fff36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,22 +6,33 @@ env: global: - CC_TEST_REPORTER_ID=98c9b3070ea9ac0e8f7afb6570f181506c3a06372b1db5c7deb8e46089fdf132 - GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi) + matrix: + - RAILS_VERSION=5.0.0 + - RAILS_VERSION=5.1.0 + - RAILS_VERSION=5.2.0 + - RAILS_VERSION=master rvm: - - 2.2.2 - - 2.3.3 + - 2.2.10 + - 2.3.7 + - 2.4.4 + - 2.5.1 - ruby-head matrix: allow_failures: - rvm: ruby-head + - env: RAILS_VERSION=master + exclude: + - rvm: 2.3.7 + env: RAILS_VERSION=master before_script: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build after_script: - # Preferably you will run test-reporter on branch update events. But - # if you setup travis to build PR updates only, you don't need to run + # Preferably you will run test-reporter on branch update events. But + # if you setup travis to build PR updates only, you don't need to run # the line below - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi - # In the case where travis is setup to build PR updates only, + # In the case where travis is setup to build PR updates only, # uncomment the line below # - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT diff --git a/Gemfile b/Gemfile index fa75df1..04a417a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,15 @@ source 'https://rubygems.org' +rails_version = ENV['RAILS_VERSION'] || "default" +rails = case rails_version + when 'master' + { github: 'rails/rails' } + when 'default' + '>= 5.0' + else + "~> #{ENV['RAILS_VERSION']}" + end + +gem 'rails', rails + gemspec diff --git a/spec/dummy/config/initializers/new_framework_defaults.rb b/spec/dummy/config/initializers/new_framework_defaults.rb index 0706caf..b6c8df7 100644 --- a/spec/dummy/config/initializers/new_framework_defaults.rb +++ b/spec/dummy/config/initializers/new_framework_defaults.rb @@ -18,7 +18,9 @@ Rails.application.config.active_record.belongs_to_required_by_default = true # Do not halt callback chains when a callback returns false. Previous versions had true. -ActiveSupport.halt_callback_chains_on_return_false = false +if Rails.version.to_f < 5.2 + ActiveSupport.halt_callback_chains_on_return_false = false +end # Configure SSL options to enable HSTS with subdomains. Previous versions had false. Rails.application.config.ssl_options = { hsts: { subdomains: true } }