Commit Graph

11 Commits

Author SHA1 Message Date
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 7b4422800d Docs: Update changelog and readme re: #1143
[ci skip]
2018-08-26 21:56:59 -04:00
Jared Beck 8b4ec38c80 Testing joins, as recommended by Sean
https://github.com/paper-trail-gem/paper_trail/pull/1143#issuecomment-415132567
2018-08-22 22:18:06 -04:00
Jared Beck e9072950b2 Add optional column: item_subtype
If present, will be populated with subclass name. This will be
used by PT-AT.
2018-08-22 00:42:37 -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
Jared Beck 97e75d7df2 Lint: working on RSpec/InstanceVariable in model_spec.rb 2018-06-07 14:43:56 -04:00
Weston Ganger d056c7e13b Add PaperTrail.config.association_reify_error_behaviour (#1091)
* add PaperTrail.config.association_reify_error_behaviour

* fix test for Rails 4.2

* PaperTrail.config.association_reify_error_behaviour test in isolation, fixes

* association_error_behaviour fix specs

* fix rubocop errors

* assoication_reify_error_behaviour fixes
2018-05-23 01:37:48 -04:00
Anton Rieder 8f8f5587e9
Change URLs to paper-trail-gem 2018-05-09 13:25:56 +02:00
Jared Beck 06a5e30ab4 Reifiers::HasOne - raise a more helpful error 2018-03-11 03:18:08 -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