Commit Graph

12 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
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 cfbf7a647c Lint: Style/FrozenStringLiteralComment 2017-12-10 23:05:39 -05:00
Jared Beck 38fa23873c Merge rails_helper into spec_helper
The reason some projects have both is so that some spec files can be
run in isolation, without the rails stuff. In practice, I don't find
myself ever doing this. So, the complexity of two files is unnecessary.
2017-05-30 00:59:55 -04:00
Jared Beck e2505c4f30 rubocop 0.48.1 (was 0.48.0) 2017-05-21 02:40:23 -04:00
Jared Beck c4148de9d0 Configure RSpec
Enable various standard configuration.
2017-05-21 02:04:28 -04:00
Jared Beck 379d9187e9 Convert unit/inheritance_column_test to rspec 2017-02-05 19:13:47 -05:00
Jared Beck 8980f08d0e Fix Style/StringLiterals: Use double quotes 2016-03-05 17:07:32 -05:00
Jared Beck 10941c8459 Fix Style/HashSyntax 2016-02-15 22:32:40 -05:00
Ninigi 297f5fcac0 legacy complient callback-methods 2015-09-15 15:06:14 +02:00
Ben Atkins 10908ed92e Fix test case from ea38e8a510 in conjunction with Protected Attributes 2015-03-01 14:20:04 -05:00
Ben Atkins ea38e8a510 Add RSpec test case for #404 2015-03-01 14:02:31 -05:00