Commit Graph

18 Commits

Author SHA1 Message Date
Todd Lynam f7a94d0b63 Skip creating version for timestamp when changed attributed is ignored via Hash
- It was only ignoring attributes defined as symbols.
- It now ignores when attributes are either defined as symbols or Hashes.
- Consolidates calculation to be shared when determining if changed and not ignored.

Resolves #1240
2020-08-16 10:15:43 -10:00
Marcelo Perini Veloso 21ead88829
Convert `item_id` field to bigint (#1245)
* convert `item_id` field to bigint

* add fix to #1242 issue to CHANGELOG.md

* change item_id type on dummy schema
2020-05-28 13:24:37 -04:00
Jared Beck f92037c048
Prepare for v11 (#1235)
* Drop support for ruby 2.3

* Docs: appraisal

* Drop support for rails <= 5.1

* Upgrade rubocop to 0.80

* Remove defunct code for EoL rails versions

* Rails 5+ style controller test params keyword

* Squash me

Co-Authored-By: Todd Lynam <TLynam@gmail.com>

Co-authored-by: Todd Lynam <TLynam@gmail.com>
2020-03-02 21:58:33 -05:00
Anton Rieder 8539cb74e8 Remove Ruby 2.7 deprecations
https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
2020-01-02 16:59:15 +01: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
Michael Khabarov ea2a3fe107 test: dummy_app is compatible with paper_trail-association_tracking v1.1.0
ref: 8cd2f3ea42 (diff-5202d4561c456760f41eb3fd3e53193b)
2019-01-01 19:51:56 +03: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 dadba10f18 Avoid changing schema during test run
Sean's approach to dropping/re-adding the column during the test run
worked, but it had a few disadvantages:

1. it required a `before(:all)` callback, which is frowned upon by rubocop-rspec
2. more importantly, it could have prevented us from using test parallelization
  in the future
3. least importantly, it produced annoying output in the middle of the test run
2018-08-13 15:51:02 -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 ffdb9df3b3 Various improvements to json_version_spec 2018-06-10 13:15:59 -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
Jared Beck 2a169ae17d Follow-up work re: touch 2018-03-16 19:06:17 -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
André Hester b833f8d19d Add explicit precision on datetime columns to enable fractional second precision on mysql 2017-12-21 23:11:32 +01:00
Jared Beck cfbf7a647c Lint: Style/FrozenStringLiteralComment 2017-12-10 23:05:39 -05:00
Hubert Pompecki 4cce9b0179 Serializing postgres arrays (#1018)
This PR addresses #1015

Starting from Rails version 5.0.2 the default serializer of PostgreSQL columns returns an ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array object instead of a string. This new object is not suitable for JSON encoding and breaks versioning of any array fields backed by Postgres.

Whenever a PostgreSQL array is used, instead of asking Active Record for a serializer we introduce our own, which simply returns the underlying array without any modifications.
2017-12-08 11:44:40 -05:00
chimame 56991ae9a1 Fix item_type in association reification query (#996)
When a record is inserted into the `versions` table, it is given an `item_type` like `Foo::Bar`, but the association reification queries were searching for an `item_type` like `::Foo::Bar`.
2017-10-04 22:02:46 -04:00
Jared Beck 94b9306647 Finish the conversion to RSpec
- Convert serializers/mixin_json_test.rb to rspec
- Convert functional/thread_safety_test.rb to rspec
- Convert functional/controller_test.rb to rspec
- Move the dummy app from test to spec, delete test dir
2017-06-10 01:45:46 -04:00