mirror of
https://github.com/paper-trail-gem/paper_trail.git
synced 2022-11-09 11:33:19 -05:00
2b479a7f08
* Change update_attributes to update In Rails 6.0 update_attributes/update_attributes! is considered deprecated. Method update/update! is the replacement. * CI: Don't use Bundler 1.16.1 - Bundler 1.16.1 has bug where dependencies can't be resolved properly when a gem is a release candidate or an alpha version. The underlying bundler issue can be found here https://github.com/bundler/bundler/issues/6449 * Disable eager_load in test env: - In Rails 6.0, rails/rails@3b95478 made a change to eagerly define attribute methods of a Model when `eager_load` is enabled. This breaks our test suite because of the way we run migration. The TL;DR is that doing `People.attribute_names` will return an empty array instead of `[:id, time_zone, ...]`. You can find a failing build here https://travis-ci.org/paper-trail-gem/paper_trail/jobs/463369634 Basically what happens is: 1) The dummy app boot, attribute methods of each model are defined but since migration didn't run yet, the tables aren't even created resulting in a empty attribute set. 2) Migration runs, but it's already too late. In this commit I disabled eager_loading in test, AFAIT there isn't much benefit in eager_loading the dummy app anyway. Also renaming the `user.rb` file to `postgres_user.rb` in order for rails autoloading to work correctly.
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
language: ruby
|
|
cache: bundler
|
|
|
|
# For ruby compatibility, we test the highest and lowest minor versions only.
|
|
# For example, if our gemspec says `required_ruby_version = ">= 2.3.0"`, and
|
|
# ruby 2.5.0 has just been released, then we test 2.3 and 2.5, but not 2.4.
|
|
rvm:
|
|
- 2.3.8
|
|
- 2.4.5
|
|
- 2.5.3
|
|
|
|
env:
|
|
global:
|
|
- TRAVIS=true
|
|
matrix:
|
|
- DB=mysql
|
|
- DB=postgres
|
|
- DB=sqlite
|
|
|
|
# We want to use `sudo: false` because the container infrastructure is supposed
|
|
# to be faster, but Travis is having issues with containers lately ..
|
|
#
|
|
# > No output has been received in the last 10m0s
|
|
#
|
|
# .. and they recommend we use the VM infrastructure (`sudo: required`) in
|
|
# the meantime.
|
|
sudo: required
|
|
|
|
before_install:
|
|
- gem update bundler
|
|
|
|
gemfile:
|
|
- gemfiles/ar_4.2.gemfile
|
|
- gemfiles/ar_5.1.gemfile
|
|
- gemfiles/ar_5.2.gemfile
|
|
- gemfiles/ar_6.0.gemfile
|
|
matrix:
|
|
exclude:
|
|
# rails 6 will not support ruby < 2.4.1
|
|
- rvm: 2.3.8
|
|
gemfile: gemfiles/ar_6.0.gemfile
|
|
# optimization: don't test intermediate rubies (see above)
|
|
- rvm: 2.4.5
|
|
gemfile: gemfiles/ar_4.2.gemfile
|
|
- rvm: 2.4.5
|
|
gemfile: gemfiles/ar_5.1.gemfile
|
|
- rvm: 2.4.5
|
|
gemfile: gemfiles/ar_5.2.gemfile
|
|
fast_finish: true
|
|
addons:
|
|
postgresql: "9.4"
|