paper_trail 6.0.2 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CONTRIBUTING.md +20 -0
  3. data/.rubocop.yml +30 -2
  4. data/.rubocop_todo.yml +20 -0
  5. data/.travis.yml +3 -5
  6. data/Appraisals +5 -6
  7. data/CHANGELOG.md +33 -0
  8. data/README.md +43 -81
  9. data/Rakefile +1 -1
  10. data/doc/bug_report_template.rb +4 -2
  11. data/gemfiles/ar_4.0.gemfile +7 -0
  12. data/gemfiles/ar_4.2.gemfile +0 -1
  13. data/lib/generators/paper_trail/templates/create_version_associations.rb +1 -1
  14. data/lib/generators/paper_trail/templates/create_versions.rb +1 -1
  15. data/lib/paper_trail.rb +7 -9
  16. data/lib/paper_trail/config.rb +0 -15
  17. data/lib/paper_trail/frameworks/rspec.rb +8 -2
  18. data/lib/paper_trail/model_config.rb +6 -2
  19. data/lib/paper_trail/record_trail.rb +3 -1
  20. data/lib/paper_trail/reifier.rb +43 -354
  21. data/lib/paper_trail/reifiers/belongs_to.rb +48 -0
  22. data/lib/paper_trail/reifiers/has_and_belongs_to_many.rb +50 -0
  23. data/lib/paper_trail/reifiers/has_many.rb +110 -0
  24. data/lib/paper_trail/reifiers/has_many_through.rb +90 -0
  25. data/lib/paper_trail/reifiers/has_one.rb +76 -0
  26. data/lib/paper_trail/serializers/yaml.rb +2 -25
  27. data/lib/paper_trail/version_concern.rb +5 -5
  28. data/lib/paper_trail/version_number.rb +7 -3
  29. data/paper_trail.gemspec +7 -34
  30. data/spec/controllers/articles_controller_spec.rb +1 -1
  31. data/spec/generators/install_generator_spec.rb +40 -34
  32. data/spec/models/animal_spec.rb +50 -25
  33. data/spec/models/boolit_spec.rb +8 -7
  34. data/spec/models/callback_modifier_spec.rb +13 -13
  35. data/spec/models/document_spec.rb +21 -0
  36. data/spec/models/gadget_spec.rb +35 -39
  37. data/spec/models/joined_version_spec.rb +4 -4
  38. data/spec/models/json_version_spec.rb +14 -15
  39. data/spec/models/not_on_update_spec.rb +1 -1
  40. data/spec/models/post_with_status_spec.rb +2 -2
  41. data/spec/models/skipper_spec.rb +4 -4
  42. data/spec/models/thing_spec.rb +1 -1
  43. data/spec/models/truck_spec.rb +1 -1
  44. data/spec/models/vehicle_spec.rb +1 -1
  45. data/spec/models/version_spec.rb +152 -168
  46. data/spec/models/widget_spec.rb +170 -196
  47. data/spec/modules/paper_trail_spec.rb +3 -3
  48. data/spec/modules/version_concern_spec.rb +5 -8
  49. data/spec/modules/version_number_spec.rb +11 -36
  50. data/spec/paper_trail/cleaner_spec.rb +152 -0
  51. data/spec/paper_trail/config_spec.rb +1 -1
  52. data/spec/paper_trail/serializers/custom_yaml_serializer_spec.rb +45 -0
  53. data/spec/paper_trail/serializers/json_spec.rb +57 -0
  54. data/spec/paper_trail/version_limit_spec.rb +55 -0
  55. data/spec/paper_trail_spec.rb +45 -32
  56. data/spec/requests/articles_spec.rb +4 -4
  57. data/test/dummy/app/models/custom_primary_key_record.rb +4 -2
  58. data/test/dummy/app/models/document.rb +1 -1
  59. data/test/dummy/app/models/not_on_update.rb +1 -1
  60. data/test/dummy/app/models/on/create.rb +6 -0
  61. data/test/dummy/app/models/on/destroy.rb +6 -0
  62. data/test/dummy/app/models/on/empty_array.rb +6 -0
  63. data/test/dummy/app/models/on/update.rb +6 -0
  64. data/test/dummy/app/models/person.rb +1 -0
  65. data/test/dummy/app/models/song.rb +19 -28
  66. data/test/dummy/config/application.rb +10 -43
  67. data/test/dummy/config/routes.rb +1 -1
  68. data/test/dummy/db/migrate/20110208155312_set_up_test_tables.rb +25 -51
  69. data/test/dummy/db/schema.rb +29 -19
  70. data/test/test_helper.rb +0 -16
  71. data/test/unit/associations_test.rb +81 -81
  72. data/test/unit/model_test.rb +48 -131
  73. data/test/unit/serializer_test.rb +34 -45
  74. data/test/unit/serializers/mixin_json_test.rb +3 -1
  75. data/test/unit/serializers/yaml_test.rb +1 -5
  76. metadata +44 -19
  77. data/lib/paper_trail/frameworks/sinatra.rb +0 -40
  78. data/test/functional/modular_sinatra_test.rb +0 -46
  79. data/test/functional/sinatra_test.rb +0 -51
  80. data/test/unit/cleaner_test.rb +0 -151
  81. data/test/unit/inheritance_column_test.rb +0 -41
  82. data/test/unit/serializers/json_test.rb +0 -95
  83. data/test/unit/serializers/mixin_yaml_test.rb +0 -53
@@ -2,8 +2,6 @@ require "test_helper"
2
2
  require "time_travel_helper"
3
3
 
4
4
  class HasPaperTrailModelTest < ActiveSupport::TestCase
5
- extend CleanupCallbacks
6
-
7
5
  context "A record with defined 'only' and 'ignore' attributes" do
8
6
  setup { @article = Article.create }
9
7
 
@@ -319,9 +317,7 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
319
317
  end
320
318
 
321
319
  should "have versions that are not live" do
322
- assert @widget.versions.map(&:reify).compact.all? { |w|
323
- !w.paper_trail.live?
324
- }
320
+ assert(@widget.versions.map(&:reify).compact.all? { |w| !w.paper_trail.live? })
325
321
  end
326
322
 
327
323
  should "have stored changes" do
@@ -1269,114 +1265,62 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
1269
1265
 
1270
1266
  context "The `on` option" do
1271
1267
  context "on create" do
1272
- cleanup_callbacks(Fluxor, :create)
1273
- cleanup_callbacks(Fluxor, :update)
1274
- cleanup_callbacks(Fluxor, :destroy)
1275
- cleanup_callbacks(Fluxor, :save)
1276
-
1277
- setup do
1278
- Fluxor.instance_eval <<-END
1279
- has_paper_trail :on => [:create]
1280
- END
1281
- @fluxor = Fluxor.create
1282
- @fluxor.update_attributes name: "blah"
1283
- @fluxor.destroy
1284
- end
1285
-
1286
1268
  should "only have a version for the create event" do
1287
- assert_equal 1, @fluxor.versions.length
1288
- assert_equal "create", @fluxor.versions.last.event
1269
+ record = ::On::Create.create(name: "Alice")
1270
+ record.update_attributes name: "blah"
1271
+ record.destroy
1272
+ assert_equal 1, record.versions.length
1273
+ assert_equal "create", record.versions.last.event
1289
1274
  end
1290
1275
  end
1291
1276
 
1292
1277
  context "on update" do
1293
- cleanup_callbacks(Fluxor, :create)
1294
- cleanup_callbacks(Fluxor, :update)
1295
- cleanup_callbacks(Fluxor, :destroy)
1296
- cleanup_callbacks(Fluxor, :save)
1297
-
1298
- setup do
1299
- Fluxor.instance_eval <<-END
1300
- has_paper_trail :on => [:update]
1301
- END
1302
- @fluxor = Fluxor.create
1303
- @fluxor.update_attributes name: "blah"
1304
- @fluxor.destroy
1305
- end
1306
-
1307
1278
  should "only have a version for the update event" do
1308
- assert_equal 1, @fluxor.versions.length
1309
- assert_equal "update", @fluxor.versions.last.event
1279
+ record = ::On::Update.create(name: "Alice")
1280
+ record.update_attributes name: "blah"
1281
+ record.destroy
1282
+ assert_equal 1, record.versions.length
1283
+ assert_equal "update", record.versions.last.event
1310
1284
  end
1311
1285
  end
1312
1286
 
1313
1287
  context "on destroy" do
1314
- cleanup_callbacks(Fluxor, :create)
1315
- cleanup_callbacks(Fluxor, :update)
1316
- cleanup_callbacks(Fluxor, :destroy)
1317
- cleanup_callbacks(Fluxor, :save)
1318
-
1319
- setup do
1320
- Fluxor.instance_eval <<-END
1321
- has_paper_trail :on => [:destroy]
1322
- END
1323
- @fluxor = Fluxor.create
1324
- @fluxor.update_attributes name: "blah"
1325
- @fluxor.destroy
1326
- end
1327
-
1328
1288
  should "only have a version for the destroy event" do
1329
- assert_equal 1, @fluxor.versions.length
1330
- assert_equal "destroy", @fluxor.versions.last.event
1289
+ record = ::On::Destroy.create(name: "Alice")
1290
+ record.update_attributes name: "blah"
1291
+ record.destroy
1292
+ assert_equal 1, record.versions.length
1293
+ assert_equal "destroy", record.versions.last.event
1331
1294
  end
1332
1295
  end
1333
1296
 
1334
1297
  context "on []" do
1335
- cleanup_callbacks(Fluxor, :create)
1336
- cleanup_callbacks(Fluxor, :update)
1337
- cleanup_callbacks(Fluxor, :destroy)
1338
- cleanup_callbacks(Fluxor, :save)
1339
-
1340
1298
  setup do
1341
- Fluxor.instance_eval <<-END
1342
- has_paper_trail :on => []
1343
- END
1344
- @fluxor = Fluxor.create
1345
- @fluxor.update_attributes name: "blah"
1299
+ @record = ::On::EmptyArray.create(name: "Alice")
1300
+ @record.update_attributes name: "blah"
1346
1301
  end
1347
1302
 
1348
1303
  teardown do
1349
- @fluxor.destroy
1304
+ @record.destroy
1350
1305
  end
1351
1306
 
1352
1307
  should "not have any versions" do
1353
- assert_equal 0, @fluxor.versions.length
1308
+ assert_equal 0, @record.versions.length
1354
1309
  end
1355
1310
 
1356
1311
  should "still respond to touch_with_version" do
1357
- @fluxor.paper_trail.touch_with_version
1358
- assert_equal 1, @fluxor.versions.length
1312
+ @record.paper_trail.touch_with_version
1313
+ assert_equal 1, @record.versions.length
1359
1314
  end
1360
1315
  end
1361
1316
 
1362
1317
  context "allows a symbol to be passed" do
1363
- cleanup_callbacks(Fluxor, :create)
1364
- cleanup_callbacks(Fluxor, :update)
1365
- cleanup_callbacks(Fluxor, :destroy)
1366
- cleanup_callbacks(Fluxor, :save)
1367
-
1368
- setup do
1369
- Fluxor.instance_eval <<-END
1370
- has_paper_trail :on => :create
1371
- END
1372
- @fluxor = Fluxor.create
1373
- @fluxor.update_attributes name: "blah"
1374
- @fluxor.destroy
1375
- end
1376
-
1377
1318
  should "only have a version for hte create event" do
1378
- assert_equal 1, @fluxor.versions.length
1379
- assert_equal "create", @fluxor.versions.last.event
1319
+ record = ::On::Create.create(name: "Alice")
1320
+ record.update_attributes name: "blah"
1321
+ record.destroy
1322
+ assert_equal 1, record.versions.length
1323
+ assert_equal "create", record.versions.last.event
1380
1324
  end
1381
1325
  end
1382
1326
  end
@@ -1419,65 +1363,38 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
1419
1363
 
1420
1364
  context "custom events" do
1421
1365
  context "on create" do
1422
- cleanup_callbacks(Fluxor, :create)
1423
- cleanup_callbacks(Fluxor, :update)
1424
- cleanup_callbacks(Fluxor, :destroy)
1425
- cleanup_callbacks(Fluxor, :save)
1426
-
1427
- setup do
1428
- Fluxor.instance_eval <<-END
1429
- has_paper_trail :on => [:create]
1430
- END
1431
- @fluxor = Fluxor.new.tap { |model| model.paper_trail_event = "created" }
1432
- @fluxor.update_attributes name: "blah"
1433
- @fluxor.destroy
1434
- end
1435
-
1436
1366
  should "only have a version for the created event" do
1437
- assert_equal 1, @fluxor.versions.length
1438
- assert_equal "created", @fluxor.versions.last.event
1367
+ record = ::On::Create.new.tap { |model|
1368
+ model.paper_trail_event = "created"
1369
+ }
1370
+ record.update_attributes name: "blah"
1371
+ record.destroy
1372
+ assert_equal 1, record.versions.length
1373
+ assert_equal "created", record.versions.last.event
1439
1374
  end
1440
1375
  end
1441
1376
 
1442
1377
  context "on update" do
1443
- cleanup_callbacks(Fluxor, :create)
1444
- cleanup_callbacks(Fluxor, :update)
1445
- cleanup_callbacks(Fluxor, :destroy)
1446
- cleanup_callbacks(Fluxor, :save)
1447
-
1448
- setup do
1449
- Fluxor.instance_eval <<-END
1450
- has_paper_trail :on => [:update]
1451
- END
1452
- @fluxor = Fluxor.create.tap { |model| model.paper_trail_event = "name_updated" }
1453
- @fluxor.update_attributes name: "blah"
1454
- @fluxor.destroy
1455
- end
1456
-
1457
1378
  should "only have a version for the name_updated event" do
1458
- assert_equal 1, @fluxor.versions.length
1459
- assert_equal "name_updated", @fluxor.versions.last.event
1379
+ record = ::On::Update.create(name: "Alice").tap { |model|
1380
+ model.paper_trail_event = "name_updated"
1381
+ }
1382
+ record.update_attributes name: "blah"
1383
+ record.destroy
1384
+ assert_equal 1, record.versions.length
1385
+ assert_equal "name_updated", record.versions.last.event
1460
1386
  end
1461
1387
  end
1462
1388
 
1463
1389
  context "on destroy" do
1464
- cleanup_callbacks(Fluxor, :create)
1465
- cleanup_callbacks(Fluxor, :update)
1466
- cleanup_callbacks(Fluxor, :destroy)
1467
- cleanup_callbacks(Fluxor, :save)
1468
-
1469
- setup do
1470
- Fluxor.instance_eval <<-END
1471
- has_paper_trail :on => [:destroy]
1472
- END
1473
- @fluxor = Fluxor.create.tap { |model| model.paper_trail_event = "destroyed" }
1474
- @fluxor.update_attributes name: "blah"
1475
- @fluxor.destroy
1476
- end
1477
-
1478
1390
  should "only have a version for the destroy event" do
1479
- assert_equal 1, @fluxor.versions.length
1480
- assert_equal "destroyed", @fluxor.versions.last.event
1391
+ record = ::On::Destroy.create(name: "Alice").tap { |model|
1392
+ model.paper_trail_event = "destroyed"
1393
+ }
1394
+ record.update_attributes name: "blah"
1395
+ record.destroy
1396
+ assert_equal 1, record.versions.length
1397
+ assert_equal "destroyed", record.versions.last.event
1481
1398
  end
1482
1399
  end
1483
1400
  end
@@ -2,36 +2,25 @@ require "test_helper"
2
2
  require "custom_json_serializer"
3
3
 
4
4
  class SerializerTest < ActiveSupport::TestCase
5
- extend CleanupCallbacks
6
-
7
- cleanup_callbacks(Fluxor, :create)
8
- cleanup_callbacks(Fluxor, :update)
9
- cleanup_callbacks(Fluxor, :destroy)
10
- cleanup_callbacks(Fluxor, :save)
11
-
12
- setup do
13
- Fluxor.instance_eval "has_paper_trail"
14
- end
15
-
16
5
  context "YAML Serializer" do
17
6
  setup do
18
- @fluxor = Fluxor.create name: "Some text."
7
+ @customer = Customer.create name: "Some text."
19
8
 
20
9
  # this is exactly what PaperTrail serializes
21
- @original_fluxor_attributes = @fluxor.paper_trail.attributes_before_change
10
+ @original_attributes = @customer.paper_trail.attributes_before_change
22
11
 
23
- @fluxor.update_attributes name: "Some more text."
12
+ @customer.update_attributes name: "Some more text."
24
13
  end
25
14
 
26
15
  should "work with the default `YAML` serializer" do
27
16
  # Normal behaviour
28
- assert_equal 2, @fluxor.versions.length
29
- assert_nil @fluxor.versions[0].reify
30
- assert_equal "Some text.", @fluxor.versions[1].reify.name
17
+ assert_equal 2, @customer.versions.length
18
+ assert_nil @customer.versions[0].reify
19
+ assert_equal "Some text.", @customer.versions[1].reify.name
31
20
 
32
21
  # Check values are stored as `YAML`.
33
- assert_equal @original_fluxor_attributes, YAML.load(@fluxor.versions[1].object)
34
- assert_equal YAML.dump(@original_fluxor_attributes), @fluxor.versions[1].object
22
+ assert_equal @original_attributes, YAML.load(@customer.versions[1].object)
23
+ assert_equal YAML.dump(@original_attributes), @customer.versions[1].object
35
24
  end
36
25
  end
37
26
 
@@ -41,12 +30,12 @@ class SerializerTest < ActiveSupport::TestCase
41
30
  config.serializer = PaperTrail::Serializers::JSON
42
31
  end
43
32
 
44
- @fluxor = Fluxor.create name: "Some text."
33
+ @customer = Customer.create name: "Some text."
45
34
 
46
35
  # this is exactly what PaperTrail serializes
47
- @original_fluxor_attributes = @fluxor.paper_trail.attributes_before_change
36
+ @original_attributes = @customer.paper_trail.attributes_before_change
48
37
 
49
- @fluxor.update_attributes name: "Some more text."
38
+ @customer.update_attributes name: "Some more text."
50
39
  end
51
40
 
52
41
  teardown do
@@ -55,22 +44,22 @@ class SerializerTest < ActiveSupport::TestCase
55
44
 
56
45
  should "reify with JSON serializer" do
57
46
  # Normal behaviour
58
- assert_equal 2, @fluxor.versions.length
59
- assert_nil @fluxor.versions[0].reify
60
- assert_equal "Some text.", @fluxor.versions[1].reify.name
47
+ assert_equal 2, @customer.versions.length
48
+ assert_nil @customer.versions[0].reify
49
+ assert_equal "Some text.", @customer.versions[1].reify.name
61
50
 
62
51
  # Check values are stored as JSON.
63
- assert_equal @original_fluxor_attributes,
64
- ActiveSupport::JSON.decode(@fluxor.versions[1].object)
65
- assert_equal ActiveSupport::JSON.encode(@original_fluxor_attributes),
66
- @fluxor.versions[1].object
52
+ assert_equal @original_attributes,
53
+ ActiveSupport::JSON.decode(@customer.versions[1].object)
54
+ assert_equal ActiveSupport::JSON.encode(@original_attributes),
55
+ @customer.versions[1].object
67
56
  end
68
57
 
69
58
  should "store object_changes" do
70
- initial_changeset = { "name" => [nil, "Some text."], "id" => [nil, @fluxor.id] }
59
+ initial_changeset = { "name" => [nil, "Some text."], "id" => [nil, @customer.id] }
71
60
  second_changeset = { "name" => ["Some text.", "Some more text."] }
72
- assert_equal initial_changeset, @fluxor.versions[0].changeset
73
- assert_equal second_changeset, @fluxor.versions[1].changeset
61
+ assert_equal initial_changeset, @customer.versions[0].changeset
62
+ assert_equal second_changeset, @customer.versions[1].changeset
74
63
  end
75
64
  end
76
65
 
@@ -80,15 +69,15 @@ class SerializerTest < ActiveSupport::TestCase
80
69
  config.serializer = CustomJsonSerializer
81
70
  end
82
71
 
83
- @fluxor = Fluxor.create
72
+ @customer = Customer.create
84
73
 
85
74
  # this is exactly what PaperTrail serializes
86
- @original_fluxor_attributes = @fluxor.
75
+ @original_attributes = @customer.
87
76
  paper_trail.
88
77
  attributes_before_change.
89
78
  reject { |_k, v| v.nil? }
90
79
 
91
- @fluxor.update_attributes name: "Some more text."
80
+ @customer.update_attributes name: "Some more text."
92
81
  end
93
82
 
94
83
  teardown do
@@ -97,22 +86,22 @@ class SerializerTest < ActiveSupport::TestCase
97
86
 
98
87
  should "reify with custom serializer" do
99
88
  # Normal behaviour
100
- assert_equal 2, @fluxor.versions.length
101
- assert_nil @fluxor.versions[0].reify
102
- assert_nil @fluxor.versions[1].reify.name
89
+ assert_equal 2, @customer.versions.length
90
+ assert_nil @customer.versions[0].reify
91
+ assert_nil @customer.versions[1].reify.name
103
92
 
104
93
  # Check values are stored as JSON.
105
- assert_equal @original_fluxor_attributes,
106
- ActiveSupport::JSON.decode(@fluxor.versions[1].object)
107
- assert_equal ActiveSupport::JSON.encode(@original_fluxor_attributes),
108
- @fluxor.versions[1].object
94
+ assert_equal @original_attributes,
95
+ ActiveSupport::JSON.decode(@customer.versions[1].object)
96
+ assert_equal ActiveSupport::JSON.encode(@original_attributes),
97
+ @customer.versions[1].object
109
98
  end
110
99
 
111
100
  should "store object_changes" do
112
- initial_changeset = { "id" => [nil, @fluxor.id] }
101
+ initial_changeset = { "id" => [nil, @customer.id] }
113
102
  second_changeset = { "name" => [nil, "Some more text."] }
114
- assert_equal initial_changeset, @fluxor.versions[0].changeset
115
- assert_equal second_changeset, @fluxor.versions[1].changeset
103
+ assert_equal initial_changeset, @customer.versions[0].changeset
104
+ assert_equal second_changeset, @customer.versions[1].changeset
116
105
  end
117
106
  end
118
107
  end
@@ -19,8 +19,10 @@ class MixinJsonTest < ActiveSupport::TestCase
19
19
  end
20
20
 
21
21
  should "`deserialize` JSON to Ruby, removing pairs with `blank` keys or values" do
22
- assert_equal @hash.reject { |k, v| k.blank? || v.blank? },
22
+ assert_equal(
23
+ @hash.reject { |k, v| k.blank? || v.blank? },
23
24
  CustomJsonSerializer.load(@hash_as_json)
25
+ )
24
26
  end
25
27
  end
26
28
 
@@ -44,11 +44,7 @@ class YamlTest < ActiveSupport::TestCase
44
44
  "Val 1"
45
45
  )
46
46
  assert matches.instance_of?(Arel::Nodes::Matches)
47
- if Arel::VERSION >= "6"
48
- assert_equal matches.right.val, "%\narg1: Val 1\n%"
49
- else
50
- assert_equal matches.right, "%\narg1: Val 1\n%"
51
- end
47
+ assert_equal matches.right.val, "%\narg1: Val 1\n%"
52
48
  end
53
49
  end
54
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paper_trail
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.2
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Stewart
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-12-14 00:00:00.000000000 Z
12
+ date: 2017-04-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -197,14 +197,28 @@ dependencies:
197
197
  requirements:
198
198
  - - "~>"
199
199
  - !ruby/object:Gem::Version
200
- version: 0.41.1
200
+ version: 0.48.0
201
201
  type: :development
202
202
  prerelease: false
203
203
  version_requirements: !ruby/object:Gem::Requirement
204
204
  requirements:
205
205
  - - "~>"
206
206
  - !ruby/object:Gem::Version
207
- version: 0.41.1
207
+ version: 0.48.0
208
+ - !ruby/object:Gem::Dependency
209
+ name: rubocop-rspec
210
+ requirement: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - "~>"
213
+ - !ruby/object:Gem::Version
214
+ version: 1.15.0
215
+ type: :development
216
+ prerelease: false
217
+ version_requirements: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - "~>"
220
+ - !ruby/object:Gem::Version
221
+ version: 1.15.0
208
222
  - !ruby/object:Gem::Dependency
209
223
  name: timecop
210
224
  requirement: !ruby/object:Gem::Requirement
@@ -286,6 +300,7 @@ files:
286
300
  - doc/bug_report_template.rb
287
301
  - doc/triage.md
288
302
  - doc/warning_about_not_setting_whodunnit.md
303
+ - gemfiles/ar_4.0.gemfile
289
304
  - gemfiles/ar_4.2.gemfile
290
305
  - gemfiles/ar_5.0.gemfile
291
306
  - gemfiles/ar_master.gemfile
@@ -313,7 +328,6 @@ files:
313
328
  - lib/paper_trail/frameworks/rails/engine.rb
314
329
  - lib/paper_trail/frameworks/rspec.rb
315
330
  - lib/paper_trail/frameworks/rspec/helpers.rb
316
- - lib/paper_trail/frameworks/sinatra.rb
317
331
  - lib/paper_trail/has_paper_trail.rb
318
332
  - lib/paper_trail/model_config.rb
319
333
  - lib/paper_trail/queries/versions/where_object.rb
@@ -321,6 +335,11 @@ files:
321
335
  - lib/paper_trail/record_history.rb
322
336
  - lib/paper_trail/record_trail.rb
323
337
  - lib/paper_trail/reifier.rb
338
+ - lib/paper_trail/reifiers/belongs_to.rb
339
+ - lib/paper_trail/reifiers/has_and_belongs_to_many.rb
340
+ - lib/paper_trail/reifiers/has_many.rb
341
+ - lib/paper_trail/reifiers/has_many_through.rb
342
+ - lib/paper_trail/reifiers/has_one.rb
324
343
  - lib/paper_trail/serializers/json.rb
325
344
  - lib/paper_trail/serializers/yaml.rb
326
345
  - lib/paper_trail/version_association_concern.rb
@@ -335,6 +354,7 @@ files:
335
354
  - spec/models/callback_modifier_spec.rb
336
355
  - spec/models/car_spec.rb
337
356
  - spec/models/custom_primary_key_record_spec.rb
357
+ - spec/models/document_spec.rb
338
358
  - spec/models/gadget_spec.rb
339
359
  - spec/models/joined_version_spec.rb
340
360
  - spec/models/json_version_spec.rb
@@ -350,7 +370,11 @@ files:
350
370
  - spec/modules/paper_trail_spec.rb
351
371
  - spec/modules/version_concern_spec.rb
352
372
  - spec/modules/version_number_spec.rb
373
+ - spec/paper_trail/cleaner_spec.rb
353
374
  - spec/paper_trail/config_spec.rb
375
+ - spec/paper_trail/serializers/custom_yaml_serializer_spec.rb
376
+ - spec/paper_trail/serializers/json_spec.rb
377
+ - spec/paper_trail/version_limit_spec.rb
354
378
  - spec/paper_trail_spec.rb
355
379
  - spec/rails_helper.rb
356
380
  - spec/requests/articles_spec.rb
@@ -389,6 +413,10 @@ files:
389
413
  - test/dummy/app/models/legacy_widget.rb
390
414
  - test/dummy/app/models/line_item.rb
391
415
  - test/dummy/app/models/not_on_update.rb
416
+ - test/dummy/app/models/on/create.rb
417
+ - test/dummy/app/models/on/destroy.rb
418
+ - test/dummy/app/models/on/empty_array.rb
419
+ - test/dummy/app/models/on/update.rb
392
420
  - test/dummy/app/models/order.rb
393
421
  - test/dummy/app/models/paragraph.rb
394
422
  - test/dummy/app/models/person.rb
@@ -431,19 +459,13 @@ files:
431
459
  - test/dummy/db/migrate/20110208155312_set_up_test_tables.rb
432
460
  - test/dummy/db/schema.rb
433
461
  - test/functional/controller_test.rb
434
- - test/functional/modular_sinatra_test.rb
435
- - test/functional/sinatra_test.rb
436
462
  - test/functional/thread_safety_test.rb
437
463
  - test/test_helper.rb
438
464
  - test/time_travel_helper.rb
439
465
  - test/unit/associations_test.rb
440
- - test/unit/cleaner_test.rb
441
- - test/unit/inheritance_column_test.rb
442
466
  - test/unit/model_test.rb
443
467
  - test/unit/serializer_test.rb
444
- - test/unit/serializers/json_test.rb
445
468
  - test/unit/serializers/mixin_json_test.rb
446
- - test/unit/serializers/mixin_yaml_test.rb
447
469
  - test/unit/serializers/yaml_test.rb
448
470
  - test/unit/version_test.rb
449
471
  homepage: https://github.com/airblade/paper_trail
@@ -458,7 +480,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
458
480
  requirements:
459
481
  - - ">="
460
482
  - !ruby/object:Gem::Version
461
- version: 1.9.3
483
+ version: 2.1.0
462
484
  required_rubygems_version: !ruby/object:Gem::Requirement
463
485
  requirements:
464
486
  - - ">="
@@ -466,7 +488,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
466
488
  version: 1.3.6
467
489
  requirements: []
468
490
  rubyforge_project:
469
- rubygems_version: 2.5.2
491
+ rubygems_version: 2.6.11
470
492
  signing_key:
471
493
  specification_version: 4
472
494
  summary: Track changes to your models.
@@ -479,6 +501,7 @@ test_files:
479
501
  - spec/models/callback_modifier_spec.rb
480
502
  - spec/models/car_spec.rb
481
503
  - spec/models/custom_primary_key_record_spec.rb
504
+ - spec/models/document_spec.rb
482
505
  - spec/models/gadget_spec.rb
483
506
  - spec/models/joined_version_spec.rb
484
507
  - spec/models/json_version_spec.rb
@@ -494,7 +517,11 @@ test_files:
494
517
  - spec/modules/paper_trail_spec.rb
495
518
  - spec/modules/version_concern_spec.rb
496
519
  - spec/modules/version_number_spec.rb
520
+ - spec/paper_trail/cleaner_spec.rb
497
521
  - spec/paper_trail/config_spec.rb
522
+ - spec/paper_trail/serializers/custom_yaml_serializer_spec.rb
523
+ - spec/paper_trail/serializers/json_spec.rb
524
+ - spec/paper_trail/version_limit_spec.rb
498
525
  - spec/paper_trail_spec.rb
499
526
  - spec/rails_helper.rb
500
527
  - spec/requests/articles_spec.rb
@@ -533,6 +560,10 @@ test_files:
533
560
  - test/dummy/app/models/legacy_widget.rb
534
561
  - test/dummy/app/models/line_item.rb
535
562
  - test/dummy/app/models/not_on_update.rb
563
+ - test/dummy/app/models/on/create.rb
564
+ - test/dummy/app/models/on/destroy.rb
565
+ - test/dummy/app/models/on/empty_array.rb
566
+ - test/dummy/app/models/on/update.rb
536
567
  - test/dummy/app/models/order.rb
537
568
  - test/dummy/app/models/paragraph.rb
538
569
  - test/dummy/app/models/person.rb
@@ -575,18 +606,12 @@ test_files:
575
606
  - test/dummy/db/migrate/20110208155312_set_up_test_tables.rb
576
607
  - test/dummy/db/schema.rb
577
608
  - test/functional/controller_test.rb
578
- - test/functional/modular_sinatra_test.rb
579
- - test/functional/sinatra_test.rb
580
609
  - test/functional/thread_safety_test.rb
581
610
  - test/test_helper.rb
582
611
  - test/time_travel_helper.rb
583
612
  - test/unit/associations_test.rb
584
- - test/unit/cleaner_test.rb
585
- - test/unit/inheritance_column_test.rb
586
613
  - test/unit/model_test.rb
587
614
  - test/unit/serializer_test.rb
588
- - test/unit/serializers/json_test.rb
589
615
  - test/unit/serializers/mixin_json_test.rb
590
- - test/unit/serializers/mixin_yaml_test.rb
591
616
  - test/unit/serializers/yaml_test.rb
592
617
  - test/unit/version_test.rb