Commit Graph

13 Commits

Author SHA1 Message Date
Jared Beck 8f5a935c3a RSpec/ContextWording 2021-08-29 22:22:39 -04:00
Jake Quain 584e2f732e Touch callback does not always create version 2021-04-05 14:03:29 -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 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 cf99fb3358 Lint: Finish fixing RSpec/NestedGroups 2017-04-01 20:13:08 -04:00
Jared Beck 0b016be756 Lint: Fix RSpec/NotToNot 2017-04-01 01:59:47 -04:00
Jared Beck af10cd4f00 Lint: Fix RSpec/ExampleWording 2017-04-01 01:50:13 -04:00
Jared Beck 3df7dc27d2 Lint: Fix Lint/AmbiguousBlockAssociation 2017-04-01 00:33:33 -04: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
Moritz Kröger 4db87dfee0 Possibility to preserve skipped attributes on reify 2015-08-03 11:01:16 +02:00
Jared Beck 40bf20beb5 Respect `:skip` re: timestamp-only updates
When attributes are ignored, either by `:ignore` or by `:skip`,
then during updates, timestamp attributes like `updated_at` should
not be considered notable changes.

[Fixes #569]
2015-07-15 22:29:19 -04:00