Commit Graph

7 Commits

Author SHA1 Message Date
Jared Beck 8f5a935c3a RSpec/ContextWording 2021-08-29 22:22:39 -04:00
Jared Beck 24f3fbcd8f PT-AT is now responsible for testing itself
See historical overview in README
2019-08-06 02:45:06 -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
lorint e8a6096aa2 Generator to update historic item_subtype entries (#1144)
* Generator to update historic item_subtype entries

* Simpler migrations for Foo and Bar test databases

* Rubocop indentation
2018-08-26 21:25:16 -04:00
Jared Beck 9f004a60e0 Revert #1108 (lorint's STI fix)
This partially reverts commit 58369e1d8f.
I have kept the specs, skipped.

Per the following, this approach does not seem to be working:

- https://github.com/paper-trail-gem/paper_trail/issues/1135
- https://github.com/paper-trail-gem/paper_trail/pull/1137
- https://github.com/seanlinsley/paper_trail/pull/1
2018-08-21 23:13:34 -04:00
lorint 58369e1d8f Fix for issue #594, reifying sub-classed models that use STI (#1108)
See the changes to the changelog and readme for details.
2018-07-30 10:50:32 -04:00
André Hester dd80ccf240 Use base class name for reification instead of class name to reify polymorphic models properly 2017-12-21 23:17:12 +01:00