1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00
Commit graph

8 commits

Author SHA1 Message Date
Jared Beck
4c4f1ec086 Lint: RSpec/ContextMethod 2019-10-21 13:06:23 -04:00
Edouard Chin
2b479a7f08 Support rails 6.0.0 (#1172)
* 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.
2018-12-04 16:10:35 -05:00
Jared Beck
4d877a7558 Remove touch_with_version, was deprecated in 9.0.0 2018-08-01 22:20:33 -04:00
Weston Ganger
02b6de2dac Integrate versioning into AR touch method (#1063)
* integrate versioning into AR touch method

* add touch to list of :on events, deprecate touch_with_version

* integrate versioning into AR touch method
2018-03-16 18:21:45 -04:00
Jared Beck
e14a6e3ac4 Followup to #1053
- Correct the changelog
- Clarify spec context
2018-03-11 00:23:07 -05:00
Weston Ganger
bd52be12a8 Fix issues with touch_with_version & conditional versioning (#1053)
[Fixes #1051]
2018-03-11 00:15:24 -05:00
Jared Beck
cfbf7a647c Lint: Style/FrozenStringLiteralComment 2017-12-10 23:05:39 -05:00
Jared Beck
7295f65a3c Organizing model tests
model_spec is far too long, let's break it up into specs for individual
models in the dummy app.

Extract spec/models/legacy_widget_spec.rb

Extract spec/models/on/empty_array_spec.rb

Extract spec/models/on/create_spec.rb

Extract spec/models/on/update_spec.rb

Extract spec/models/on/destroy_spec.rb

Move an example to config_spec.rb

Extract spec/models/translation_spec.rb

Extract spec/models/article_spec.rb

Move examples to document_spec.rb
2017-07-05 00:15:15 -04:00