paper_trail 7.1.0 → 7.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/lib/paper_trail/record_trail.rb +1 -1
  3. data/lib/paper_trail/version_number.rb +1 -1
  4. metadata +3 -274
  5. data/.github/CONTRIBUTING.md +0 -151
  6. data/.github/ISSUE_TEMPLATE.md +0 -13
  7. data/.gitignore +0 -23
  8. data/.rspec +0 -2
  9. data/.rubocop.yml +0 -135
  10. data/.rubocop_todo.yml +0 -41
  11. data/.travis.yml +0 -41
  12. data/Appraisals +0 -26
  13. data/CHANGELOG.md +0 -739
  14. data/Gemfile +0 -2
  15. data/MIT-LICENSE +0 -20
  16. data/README.md +0 -1613
  17. data/Rakefile +0 -38
  18. data/doc/bug_report_template.rb +0 -73
  19. data/doc/triage.md +0 -27
  20. data/doc/warning_about_not_setting_whodunnit.md +0 -33
  21. data/gemfiles/ar_4.0.gemfile +0 -7
  22. data/gemfiles/ar_4.2.gemfile +0 -7
  23. data/gemfiles/ar_5.0.gemfile +0 -8
  24. data/gemfiles/ar_5.1.gemfile +0 -8
  25. data/gemfiles/ar_master.gemfile +0 -9
  26. data/lib/generators/paper_trail/default_initializer.rb +0 -0
  27. data/paper_trail.gemspec +0 -49
  28. data/spec/controllers/articles_controller_spec.rb +0 -28
  29. data/spec/controllers/widgets_controller_spec.rb +0 -85
  30. data/spec/dummy_app/Rakefile +0 -7
  31. data/spec/dummy_app/app/controllers/application_controller.rb +0 -30
  32. data/spec/dummy_app/app/controllers/articles_controller.rb +0 -16
  33. data/spec/dummy_app/app/controllers/test_controller.rb +0 -5
  34. data/spec/dummy_app/app/controllers/widgets_controller.rb +0 -28
  35. data/spec/dummy_app/app/models/animal.rb +0 -4
  36. data/spec/dummy_app/app/models/article.rb +0 -25
  37. data/spec/dummy_app/app/models/authorship.rb +0 -5
  38. data/spec/dummy_app/app/models/bar_habtm.rb +0 -4
  39. data/spec/dummy_app/app/models/book.rb +0 -9
  40. data/spec/dummy_app/app/models/boolit.rb +0 -4
  41. data/spec/dummy_app/app/models/callback_modifier.rb +0 -45
  42. data/spec/dummy_app/app/models/car.rb +0 -3
  43. data/spec/dummy_app/app/models/cat.rb +0 -2
  44. data/spec/dummy_app/app/models/chapter.rb +0 -9
  45. data/spec/dummy_app/app/models/citation.rb +0 -5
  46. data/spec/dummy_app/app/models/custom_primary_key_record.rb +0 -15
  47. data/spec/dummy_app/app/models/customer.rb +0 -4
  48. data/spec/dummy_app/app/models/document.rb +0 -8
  49. data/spec/dummy_app/app/models/dog.rb +0 -2
  50. data/spec/dummy_app/app/models/editor.rb +0 -4
  51. data/spec/dummy_app/app/models/editorship.rb +0 -5
  52. data/spec/dummy_app/app/models/elephant.rb +0 -3
  53. data/spec/dummy_app/app/models/fluxor.rb +0 -3
  54. data/spec/dummy_app/app/models/foo_habtm.rb +0 -5
  55. data/spec/dummy_app/app/models/foo_widget.rb +0 -2
  56. data/spec/dummy_app/app/models/fruit.rb +0 -5
  57. data/spec/dummy_app/app/models/gadget.rb +0 -3
  58. data/spec/dummy_app/app/models/kitchen/banana.rb +0 -5
  59. data/spec/dummy_app/app/models/legacy_widget.rb +0 -6
  60. data/spec/dummy_app/app/models/line_item.rb +0 -4
  61. data/spec/dummy_app/app/models/not_on_update.rb +0 -4
  62. data/spec/dummy_app/app/models/on/create.rb +0 -6
  63. data/spec/dummy_app/app/models/on/destroy.rb +0 -6
  64. data/spec/dummy_app/app/models/on/empty_array.rb +0 -6
  65. data/spec/dummy_app/app/models/on/update.rb +0 -6
  66. data/spec/dummy_app/app/models/order.rb +0 -5
  67. data/spec/dummy_app/app/models/paragraph.rb +0 -5
  68. data/spec/dummy_app/app/models/person.rb +0 -39
  69. data/spec/dummy_app/app/models/post.rb +0 -3
  70. data/spec/dummy_app/app/models/post_with_status.rb +0 -7
  71. data/spec/dummy_app/app/models/quotation.rb +0 -5
  72. data/spec/dummy_app/app/models/section.rb +0 -6
  73. data/spec/dummy_app/app/models/skipper.rb +0 -3
  74. data/spec/dummy_app/app/models/song.rb +0 -37
  75. data/spec/dummy_app/app/models/thing.rb +0 -3
  76. data/spec/dummy_app/app/models/translation.rb +0 -11
  77. data/spec/dummy_app/app/models/truck.rb +0 -4
  78. data/spec/dummy_app/app/models/vehicle.rb +0 -4
  79. data/spec/dummy_app/app/models/whatchamajigger.rb +0 -4
  80. data/spec/dummy_app/app/models/widget.rb +0 -8
  81. data/spec/dummy_app/app/models/wotsit.rb +0 -8
  82. data/spec/dummy_app/app/versions/custom_primary_key_record_version.rb +0 -3
  83. data/spec/dummy_app/app/versions/joined_version.rb +0 -6
  84. data/spec/dummy_app/app/versions/json_version.rb +0 -3
  85. data/spec/dummy_app/app/versions/kitchen/banana_version.rb +0 -5
  86. data/spec/dummy_app/app/versions/post_version.rb +0 -3
  87. data/spec/dummy_app/config.ru +0 -4
  88. data/spec/dummy_app/config/application.rb +0 -39
  89. data/spec/dummy_app/config/boot.rb +0 -24
  90. data/spec/dummy_app/config/database.mysql.yml +0 -19
  91. data/spec/dummy_app/config/database.postgres.yml +0 -15
  92. data/spec/dummy_app/config/database.sqlite.yml +0 -15
  93. data/spec/dummy_app/config/environment.rb +0 -5
  94. data/spec/dummy_app/config/environments/development.rb +0 -36
  95. data/spec/dummy_app/config/environments/production.rb +0 -74
  96. data/spec/dummy_app/config/environments/test.rb +0 -46
  97. data/spec/dummy_app/config/initializers/backtrace_silencers.rb +0 -9
  98. data/spec/dummy_app/config/initializers/inflections.rb +0 -10
  99. data/spec/dummy_app/config/initializers/mime_types.rb +0 -5
  100. data/spec/dummy_app/config/initializers/paper_trail.rb +0 -1
  101. data/spec/dummy_app/config/initializers/secret_token.rb +0 -9
  102. data/spec/dummy_app/config/initializers/session_store.rb +0 -8
  103. data/spec/dummy_app/config/locales/en.yml +0 -5
  104. data/spec/dummy_app/config/routes.rb +0 -4
  105. data/spec/dummy_app/db/migrate/20110208155312_set_up_test_tables.rb +0 -344
  106. data/spec/dummy_app/db/schema.rb +0 -298
  107. data/spec/generators/install_generator_spec.rb +0 -88
  108. data/spec/models/animal_spec.rb +0 -61
  109. data/spec/models/article_spec.rb +0 -186
  110. data/spec/models/boolit_spec.rb +0 -41
  111. data/spec/models/callback_modifier_spec.rb +0 -92
  112. data/spec/models/car_spec.rb +0 -13
  113. data/spec/models/custom_primary_key_record_spec.rb +0 -18
  114. data/spec/models/document_spec.rb +0 -57
  115. data/spec/models/gadget_spec.rb +0 -63
  116. data/spec/models/joined_version_spec.rb +0 -41
  117. data/spec/models/json_version_spec.rb +0 -101
  118. data/spec/models/kitchen/banana_spec.rb +0 -14
  119. data/spec/models/legacy_widget_spec.rb +0 -40
  120. data/spec/models/not_on_update_spec.rb +0 -22
  121. data/spec/models/on/create_spec.rb +0 -27
  122. data/spec/models/on/destroy_spec.rb +0 -27
  123. data/spec/models/on/empty_array_spec.rb +0 -30
  124. data/spec/models/on/update_spec.rb +0 -27
  125. data/spec/models/post_with_status_spec.rb +0 -46
  126. data/spec/models/skipper_spec.rb +0 -42
  127. data/spec/models/thing_spec.rb +0 -11
  128. data/spec/models/translation_spec.rb +0 -70
  129. data/spec/models/vehicle_spec.rb +0 -5
  130. data/spec/models/version_spec.rb +0 -282
  131. data/spec/models/widget_spec.rb +0 -338
  132. data/spec/modules/paper_trail_spec.rb +0 -27
  133. data/spec/modules/version_concern_spec.rb +0 -28
  134. data/spec/modules/version_number_spec.rb +0 -18
  135. data/spec/paper_trail/associations_spec.rb +0 -965
  136. data/spec/paper_trail/cleaner_spec.rb +0 -152
  137. data/spec/paper_trail/config_spec.rb +0 -45
  138. data/spec/paper_trail/model_spec.rb +0 -992
  139. data/spec/paper_trail/serializer_spec.rb +0 -85
  140. data/spec/paper_trail/serializers/custom_json_serializer_spec.rb +0 -18
  141. data/spec/paper_trail/serializers/custom_yaml_serializer_spec.rb +0 -45
  142. data/spec/paper_trail/serializers/json_spec.rb +0 -57
  143. data/spec/paper_trail/serializers/yaml_spec.rb +0 -42
  144. data/spec/paper_trail/thread_safety_spec.rb +0 -44
  145. data/spec/paper_trail/version_limit_spec.rb +0 -55
  146. data/spec/paper_trail/version_spec.rb +0 -96
  147. data/spec/paper_trail_spec.rb +0 -122
  148. data/spec/requests/articles_spec.rb +0 -34
  149. data/spec/spec_helper.rb +0 -78
  150. data/spec/support/alt_db_init.rb +0 -54
  151. data/spec/support/custom_json_serializer.rb +0 -13
@@ -1,13 +0,0 @@
1
- Thanks for your interest in PaperTrail! Our volunteers' time is limited, so we
2
- can only respond on GitHub to bug reports and feature requests. Please ask
3
- *usage questions* on StackOverflow (https://stackoverflow.com/tags/paper-trail-gem)
4
- so that the whole community has a chance to answer your question.
5
-
6
- Please use our template
7
- (https://github.com/airblade/paper_trail/blob/master/doc/bug_report_template.rb)
8
- when reporting bugs.
9
-
10
- For other questions, please see our contributing guide.
11
- (https://github.com/airblade/paper_trail/blob/master/.github/CONTRIBUTING.md)
12
-
13
- Thanks for your contribution!
data/.gitignore DELETED
@@ -1,23 +0,0 @@
1
- gemfiles/*.lock
2
- NOTES
3
- test/debug.log
4
- test/paper_trail_plugin.sqlite3.db
5
- spec/dummy_app/config/database.yml
6
- spec/dummy_app/db/*.sqlite3
7
- spec/dummy_app/log/*
8
- spec/dummy_app/tmp/*
9
- spec/dummy/
10
- coverage
11
- pkg/*
12
- *.gem
13
- .bundle
14
- .rbenv-version
15
- Gemfile.lock
16
- vendor/*
17
- .idea
18
- .rvmrc
19
- .tags
20
- .tags_sorted_by_file
21
- .ruby-version
22
- .ruby-gemset
23
- .rbenv-gemsets
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,135 +0,0 @@
1
- require:
2
- - rubocop-rspec
3
-
4
- inherit_from: .rubocop_todo.yml
5
-
6
- # Please:
7
- #
8
- # - Comment any deviations from the Ruby Style Guide
9
- # - Alphabetize cops
10
- # - Only include permanent config; temporary goes in .rubocop_todo.yml
11
-
12
- AllCops:
13
- Exclude:
14
- - gemfiles/vendor/bundle/**/* # This dir only shows up on travis ¯\_(ツ)_/¯
15
- - spec/dummy_app/db/schema.rb # Generated, out of our control
16
-
17
- # Set to lowest supported version
18
- TargetRubyVersion: 2.1
19
-
20
- # Migrations often contain long up/down methods, and extracting smaller methods
21
- # from these is of questionable value.
22
- Metrics/AbcSize:
23
- Exclude:
24
- - 'spec/dummy_app/db/migrate/*'
25
-
26
- # Not a useful metric compared to, e.g. `AbcSize`.
27
- Metrics/BlockLength:
28
- Enabled: false
29
-
30
- # Not a useful metric compared to, e.g. `AbcSize`.
31
- Metrics/ClassLength:
32
- Enabled: false
33
-
34
- # The Ruby Style Guide recommends to "Limit lines to 80 characters."
35
- # (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
36
- # but 100 is also reasonable.
37
- Metrics/LineLength:
38
- Max: 100
39
-
40
- # The number of lines in a method is not a useful metric compared to `AbcSize`.
41
- # It's common to have very long methods (> 50 lines) which are quite simple. For
42
- # example, a method that returns a long string with only a few interpolations.
43
- Metrics/MethodLength:
44
- Enabled: false
45
-
46
- # Not a useful metric compared to, e.g. `AbcSize`.
47
- Metrics/ModuleLength:
48
- Enabled: false
49
-
50
- # In an ideal world, each example has a single expectation. In the real world,
51
- # sometimes setup is a pain and you don't want to duplicate setup in multiple
52
- # examples, or make the specs more confusing with many nested `context`s, and
53
- # the practical thing is to have multiple expectations.
54
- RSpec/MultipleExpectations:
55
- Enabled: false
56
-
57
- # Yes, ideally examples would be short. Is it possible to pick a limit and say,
58
- # "no example will ever be longer than this"? Hard to say. Sometimes they're
59
- # quite long.
60
- RSpec/ExampleLength:
61
- Enabled: false
62
-
63
- Style/AlignParameters:
64
- EnforcedStyle: with_fixed_indentation
65
-
66
- # Please use semantic style, e.g. `do` when there's a side-effect, else `{}`.
67
- # The semantic style is too nuanced to lint, so the cop is disabled.
68
- Style/BlockDelimiters:
69
- Enabled: false
70
-
71
- Style/DotPosition:
72
- EnforcedStyle: trailing
73
-
74
- # Use double negation wherever it would otherwise be impractical to convert
75
- # a value to an actual boolean.
76
- Style/DoubleNegation:
77
- Enabled: false
78
-
79
- Style/FileName:
80
- Exclude:
81
- - Appraisals
82
-
83
- # The decision of when to use a guard clause to improve readability is subtle,
84
- # and it's not clear that it can be linted. Certainly, the default
85
- # `MinBodyLength` of 1 can actually hurt readability.
86
- Style/GuardClause:
87
- Enabled: false
88
-
89
- # Use postfix (modifier) conditionals for one-liners, unless doing so would
90
- # exceed 60 characters.
91
- Style/IfUnlessModifier:
92
- MaxLineLength: 60
93
-
94
- Style/IndentHeredoc:
95
- Exclude:
96
- - paper_trail.gemspec
97
-
98
- # The Ruby Style Guide says:
99
- #
100
- # > Use \ instead of + or << to concatenate two string literals at line end.
101
- #
102
- # but in my experience the `\` style is rarely used and less readable. Please
103
- # concatenate multiline strings with `+` or use a HEREDOC.
104
- Style/LineEndConcatenation:
105
- Enabled: false
106
-
107
- # Using `module_function` instead of `extend self` would make the instance
108
- # methods in these modules private. That would be a breaking change, so these
109
- # modules are excluded. See discussion in:
110
- # - https://github.com/airblade/paper_trail/pull/756
111
- # - https://github.com/bbatsov/ruby-style-guide/issues/556
112
- Style/ModuleFunction:
113
- Exclude:
114
- - 'lib/paper_trail/serializers/json.rb'
115
- - 'lib/paper_trail/serializers/yaml.rb'
116
-
117
- Style/MultilineMethodCallIndentation:
118
- EnforcedStyle: indented
119
-
120
- Style/MultilineOperationIndentation:
121
- EnforcedStyle: indented
122
-
123
- Style/PredicateName:
124
- NameWhitelist: has_paper_trail
125
-
126
- # The Ruby Style Guide does not prescribe a particular quote character, only
127
- # that a project should pick one and be consistent. The decision has no
128
- # performance implications. Double quotes are slightly easier to read.
129
- Style/StringLiterals:
130
- EnforcedStyle: double_quotes
131
-
132
- # Use exactly one space on each side of an operator. Do not align operators
133
- # because it makes the code harder to edit, and makes lines unnecessarily long.
134
- Style/SpaceAroundOperators:
135
- AllowForAlignment: false
data/.rubocop_todo.yml DELETED
@@ -1,41 +0,0 @@
1
- require: rubocop-rspec
2
-
3
- # Remove these configuration records
4
- # one by one as the offenses are removed from the code base.
5
-
6
- Metrics/AbcSize:
7
- Max: 22 # Goal: 15
8
-
9
- Metrics/CyclomaticComplexity:
10
- Max: 8 # Goal: 6
11
-
12
- Metrics/PerceivedComplexity:
13
- Max: 9 # Goal: 7
14
-
15
- Style/FrozenStringLiteralComment:
16
- Enabled: false
17
-
18
- RSpec/BeforeAfterAll:
19
- Enabled: false
20
-
21
- RSpec/FilePath:
22
- Enabled: false
23
-
24
- RSpec/InstanceVariable:
25
- Exclude:
26
- - spec/paper_trail/associations_spec.rb
27
- - spec/paper_trail/model_spec.rb
28
-
29
- RSpec/MessageSpies:
30
- Enabled: false
31
-
32
- RSpec/NamedSubject:
33
- Enabled: false
34
-
35
- RSpec/NestedGroups:
36
- Exclude:
37
- - spec/paper_trail/associations_spec.rb
38
- - spec/paper_trail/model_spec.rb
39
-
40
- Security/YAMLLoad:
41
- Enabled: false
data/.travis.yml DELETED
@@ -1,41 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- rvm:
4
- - 2.3.4
5
- - 2.1.10
6
- env:
7
- global:
8
- - TRAVIS=true
9
- matrix:
10
- - DB=mysql
11
- - DB=postgres
12
- - DB=sqlite
13
-
14
- sudo: false
15
-
16
- before_script:
17
- - mysql --version
18
- - sh -c "if [ \"$DB\" = 'mysql' ]; then mysql -e 'create database paper_trail_test;'; fi"
19
- - sh -c "if [ \"$DB\" = 'mysql' ]; then mysql -e 'create database paper_trail_bar; '; fi"
20
- - sh -c "if [ \"$DB\" = 'mysql' ]; then mysql -e 'create database paper_trail_foo; '; fi"
21
- - psql --version
22
- - sh -c "if [ \"$DB\" = 'postgres' ]; then psql -c 'create database paper_trail_test;' -U postgres; fi"
23
- - sh -c "if [ \"$DB\" = 'postgres' ]; then psql -c 'create database paper_trail_bar;' -U postgres; fi"
24
- - sh -c "if [ \"$DB\" = 'postgres' ]; then psql -c 'create database paper_trail_foo;' -U postgres; fi"
25
-
26
- gemfile:
27
- - gemfiles/ar_4.0.gemfile
28
- - gemfiles/ar_4.2.gemfile
29
- - gemfiles/ar_5.0.gemfile
30
- - gemfiles/ar_5.1.gemfile
31
-
32
- matrix:
33
- fast_finish: true
34
- exclude:
35
- - gemfile: gemfiles/ar_5.0.gemfile
36
- rvm: 2.1.10
37
- - gemfile: gemfiles/ar_5.1.gemfile
38
- rvm: 2.1.10
39
-
40
- addons:
41
- postgresql: "9.4"
data/Appraisals DELETED
@@ -1,26 +0,0 @@
1
- # Specify here only version constraints that differ from
2
- # `paper_trail.gemspec`.
3
- #
4
- # > The dependencies in your Appraisals file are combined with dependencies in
5
- # > your Gemfile, so you don't need to repeat anything that's the same for each
6
- # > appraisal. If something is specified in both the Gemfile and an appraisal,
7
- # > the version from the appraisal takes precedence.
8
- # > https://github.com/thoughtbot/appraisal
9
-
10
- appraise "ar-4.0" do
11
- gem "activerecord", "~> 4.0"
12
- end
13
-
14
- appraise "ar-4.2" do
15
- gem "activerecord", "~> 4.2"
16
- end
17
-
18
- appraise "ar-5.0" do
19
- gem "activerecord", "~> 5.0.3"
20
- gem "rails-controller-testing"
21
- end
22
-
23
- appraise "ar-5.1" do
24
- gem "rails", "5.1.1"
25
- gem "rails-controller-testing"
26
- end
data/CHANGELOG.md DELETED
@@ -1,739 +0,0 @@
1
- # Changelog
2
-
3
- This project follows [semver 2.0.0](http://semver.org/spec/v2.0.0.html) and the
4
- recommendations of [keepachangelog.com](http://keepachangelog.com/).
5
-
6
- ## Unreleased
7
-
8
- ### Breaking Changes
9
-
10
- - None
11
-
12
- ### Added
13
-
14
- - None
15
-
16
- ### Fixed
17
-
18
- - None
19
-
20
- ## 7.1.0 (2017-07-09)
21
-
22
- ### Breaking Changes
23
-
24
- - None
25
-
26
- ### Added
27
-
28
- - [#803](https://github.com/airblade/paper_trail/issues/803)
29
- Deprecate `where_object_changes` when reading json from a text column
30
- - [#976](https://github.com/airblade/paper_trail/pull/976)
31
- `PaperTrail.whodunnit` accepts a `Proc`
32
-
33
- ### Fixed
34
-
35
- - None
36
-
37
- ## 7.0.3 (2017-06-01)
38
-
39
- ### Breaking Changes
40
-
41
- - None
42
-
43
- ### Added
44
-
45
- - None
46
-
47
- ### Fixed
48
-
49
- - [#959](https://github.com/airblade/paper_trail/pull/959) -
50
- Add migration version (eg. `[5.1]`) to all migration generators.
51
-
52
- ## 7.0.2 (2017-04-26)
53
-
54
- ### Breaking Changes
55
-
56
- - None
57
-
58
- ### Added
59
-
60
- - [#932](https://github.com/airblade/paper_trail/pull/932) -
61
- `PaperTrail.whodunnit` now accepts a block.
62
-
63
- ### Fixed
64
-
65
- - [#956](https://github.com/airblade/paper_trail/pull/956) -
66
- Fix ActiveRecord >= 5.1 version check
67
-
68
- ## 7.0.1 (2017-04-10)
69
-
70
- ### Breaking Changes
71
-
72
- - None
73
-
74
- ### Added
75
-
76
- - Generate cleaner migrations for databases other than MySQL
77
-
78
- ### Fixed
79
-
80
- - [#949](https://github.com/airblade/paper_trail/issues/949) - Inherit from the
81
- new versioned migration class, e.g. `ActiveRecord::Migration[5.1]`
82
-
83
- ## 7.0.0 (2017-04-01)
84
-
85
- ### Breaking Changes
86
-
87
- - Drop support for ruby 1.9.3, whose EOL was 2015-02-23
88
- - Drop support for ruby 2.0.0, whose EOL was 2016-02-24
89
- - Remove deprecated config methods:
90
- - PaperTrail.serialized_attributes?
91
- - PaperTrail.config.serialized_attributes
92
- - PaperTrail.config.serialized_attributes=
93
- - Sinatra integration moved to
94
- [paper_trail-sinatra](https://github.com/jaredbeck/paper_trail-sinatra) gem
95
-
96
- ### Added
97
-
98
- - `PaperTrail.gem_version` returns a `Gem::Version`, nice for comparisons.
99
-
100
- ### Fixed
101
-
102
- - [#925](https://github.com/airblade/paper_trail/pull/925) - Update RSpec
103
- matchers to work with custom version association names
104
- - [#929](https://github.com/airblade/paper_trail/pull/929) -
105
- Fix error calling private method in rails 4.0
106
- - [#938](https://github.com/airblade/paper_trail/pull/938) - Fix bug where
107
- non-standard foreign key names broke belongs_to associations
108
- - [#940](https://github.com/airblade/paper_trail/pull/940) - When destroying
109
- versions to stay under version_limit, don't rely on the database to
110
- implicitly return the versions in the right order
111
-
112
- ## 6.0.2 (2016-12-13)
113
-
114
- ### Breaking Changes
115
-
116
- - None
117
-
118
- ### Added
119
-
120
- - None
121
-
122
- ### Fixed
123
-
124
- - `88e513f` - Surprise argument modification bug in `where_object_changes`
125
- - `c7efd62` - Column type-detection bug in `where_object_changes`
126
- - [#905](https://github.com/airblade/paper_trail/pull/905) - Only invoke
127
- `logger.warn` if `logger` instance exists
128
-
129
- ### Code Quality
130
-
131
- - Improve Metrics/AbcSize from 30 to 22
132
- - Improve Metrics/PerceivedComplexity from 10 to 9
133
-
134
- ## 6.0.1 (2016-12-04)
135
-
136
- ### Breaking Changes
137
-
138
- - None
139
-
140
- ### Added
141
-
142
- - None
143
-
144
- ### Fixed
145
-
146
- - Remove rails 3 features that are no longer supported, most notably,
147
- `protected_attributes`.
148
-
149
- ## 6.0.0 (2016-12-03)
150
-
151
- Now with rails 5.1 support, and less model pollution! About 40 methods that were
152
- polluting your models' namespaces have been removed, reducing the chances of a
153
- name conflict with your methods.
154
-
155
- ### Breaking Changes
156
-
157
- - [#898](https://github.com/airblade/paper_trail/pull/898) - Dropped support
158
- for rails 3
159
- - [#864](https://github.com/airblade/paper_trail/pull/864) - The model methods
160
- deprecated in 5.2.0 have been removed. Use `paper_trail.x` instead of `x`.
161
- - [#861](https://github.com/airblade/paper_trail/pull/861) - `timestamp_field=`
162
- removed without replacement. It is no longer configurable. The
163
- timestamp field in the `versions` table must now be named `created_at`.
164
-
165
- ### Deprecated
166
-
167
- - None
168
-
169
- ### Added
170
-
171
- - [#900](https://github.com/airblade/paper_trail/pull/900/files) -
172
- Support for rails 5.1
173
- - [#881](https://github.com/airblade/paper_trail/pull/881) - Add RSpec matcher
174
- `have_a_version_with_changes` for easier testing.
175
-
176
- ### Fixed
177
-
178
- - None
179
-
180
- ## 5.2.3 (2016-11-29)
181
-
182
- ### Breaking Changes
183
-
184
- - None
185
-
186
- ### Deprecated
187
-
188
- - None
189
-
190
- ### Added
191
-
192
- - None
193
-
194
- ### Fixed
195
-
196
- - [#889](https://github.com/airblade/paper_trail/pull/889) -
197
- Fix warning message in instances when a version can't be persisted due to validation errors.
198
- - [#868](https://github.com/airblade/paper_trail/pull/868)
199
- Fix usage of find_by_id when primary key is not id, affecting reifying certain records.
200
-
201
-
202
- ## 5.2.2 (2016-09-08)
203
-
204
- ### Breaking Changes
205
-
206
- - None
207
-
208
- ### Deprecated
209
-
210
- - [#863](https://github.com/airblade/paper_trail/pull/863) -
211
- PaperTrail.timestamp_field= deprecated without replacement.
212
- See [#861](https://github.com/airblade/paper_trail/pull/861) for discussion.
213
-
214
- ### Added
215
-
216
- - None
217
-
218
- ### Fixed
219
-
220
- - None
221
-
222
- ## 5.2.1 (2016-09-02)
223
-
224
- ### Breaking Changes
225
-
226
- - None
227
-
228
- ### Deprecated
229
-
230
- - None
231
-
232
- ### Added
233
-
234
- - None
235
-
236
- ### Fixed
237
-
238
- - [#857](https://github.com/airblade/paper_trail/pull/857) -
239
- Fix deserialization of enums written by PT 4.
240
- - [#798](https://github.com/airblade/paper_trail/issues/798) -
241
- Fix a rare bug with serialization of enums in rails 4.2 only when
242
- using `touch_with_version`.
243
-
244
- ## 5.2.0 (2016-06-27)
245
-
246
- ### Breaking Changes
247
-
248
- - None
249
-
250
- ### Deprecated
251
-
252
- - [#719](https://github.com/airblade/paper_trail/pull/719) -
253
- The majority of model methods. Use paper_trail.x instead of x. Why? Your
254
- models are a crowded namespace, and we want to get out of your way!
255
-
256
- ### Added
257
-
258
- - None
259
-
260
- ### Fixed
261
-
262
- - None
263
-
264
- ## 5.1.1 (2016-05-31)
265
-
266
- ### Breaking Changes
267
-
268
- - None
269
-
270
- ### Added
271
-
272
- - None
273
-
274
- ### Fixed
275
-
276
- - [#813](https://github.com/airblade/paper_trail/pull/813) -
277
- Warning for paper_trail_on_destroy(:after) for pre-releases of AR 5
278
- - [#651](https://github.com/airblade/paper_trail/issues/651) -
279
- Bug with installing PT on MySQL <= 5.6
280
-
281
- ## 5.1.0 (2016-05-20)
282
-
283
- ### Breaking Changes
284
-
285
- - None
286
-
287
- ### Added
288
-
289
- - [#809](https://github.com/airblade/paper_trail/pull/809) -
290
- Print warning if version cannot be saved.
291
-
292
- ### Fixed
293
-
294
- - [#812](https://github.com/airblade/paper_trail/pull/812) -
295
- Issue with saving HABTM associated objects using accepts_nested_attributes_for
296
- - [#811](https://github.com/airblade/paper_trail/pull/811) -
297
- Avoid unnecessary query in #record_destroy
298
- - Improvements to documentation
299
-
300
- ## 5.0.1 (2016-05-04)
301
-
302
- ### Breaking Changes
303
-
304
- - None
305
-
306
- ### Added
307
-
308
- - None
309
-
310
- ### Fixed
311
-
312
- - [#791](https://github.com/airblade/paper_trail/issues/791) -
313
- A rare issue in applications that override `warn`.
314
- - [#789](https://github.com/airblade/paper_trail/issues/789) -
315
- A potentially common issue, in applications with initializers that use
316
- versioned models.
317
-
318
- ## 5.0.0 (2016-05-02)
319
-
320
- ### Breaking Changes
321
-
322
- - [#758](https://github.com/airblade/paper_trail/pull/758) -
323
- `PaperTrail.config.track_associations` getter method removed,
324
- use `track_associations?` instead.
325
- - [#740](https://github.com/airblade/paper_trail/issues/740) -
326
- `PaperTrail.config.track_associations?` now defaults to false
327
- - [#723](https://github.com/airblade/paper_trail/pull/723) -
328
- `PaperTrail.enabled=` now affects all threads
329
- - [#556](https://github.com/airblade/paper_trail/pull/556) /
330
- [#301](https://github.com/airblade/paper_trail/issues/301) -
331
- If you are tracking who is responsible for changes with `whodunnit`, be aware
332
- that PaperTrail no longer adds the `set_paper_trail_whodunnit` before_action
333
- for you. Please add this before_action to your ApplicationController to
334
- continue recording whodunnit. See the readme for an example.
335
- - [#683](https://github.com/airblade/paper_trail/pull/683) /
336
- [#682](https://github.com/airblade/paper_trail/issues/682) -
337
- Destroy callback default changed to :before to accommodate ActiveRecord 5
338
- option `belongs_to_required_by_default` and new Rails 5 default.
339
-
340
- ### Added
341
-
342
- - [#771](https://github.com/airblade/paper_trail/pull/771) -
343
- Added support for has_and_belongs_to_many associations
344
- - [#741](https://github.com/airblade/paper_trail/issues/741) /
345
- [#681](https://github.com/airblade/paper_trail/pull/681)
346
- MySQL unicode support in migration generator
347
- - [#689](https://github.com/airblade/paper_trail/pull/689) -
348
- Rails 5 compatibility
349
- - Added a rails config option: `config.paper_trail.enabled`
350
- - [#503](https://github.com/airblade/paper_trail/pull/730) -
351
- Support for reifying belongs_to associations.
352
-
353
- ### Fixed
354
-
355
- - [#777](https://github.com/airblade/paper_trail/issues/777) -
356
- Support HMT associations with `:source` option.
357
- - [#738](https://github.com/airblade/paper_trail/issues/738) -
358
- Rare bug where a non-versioned STI parent caused `changeset` to
359
- return an empty hash.
360
- - [#731](https://github.com/airblade/paper_trail/pull/731) -
361
- Map enums to database values before storing in `object_changes` column.
362
- - [#715](https://github.com/airblade/paper_trail/issues/715) -
363
- Optimize post-rollback association reset.
364
- - [#701](https://github.com/airblade/paper_trail/pull/701) /
365
- [#699](https://github.com/airblade/paper_trail/issues/699) -
366
- Cleaning old versions explicitly preserves the most recent
367
- versions instead of relying on database result ordering.
368
- - [#635](https://github.com/airblade/paper_trail/issues/635) -
369
- A bug where it was not possible to disable PT when using a multi-threaded
370
- webserver.
371
- - [#584](https://github.com/airblade/paper_trail/issues/584) -
372
- Fixed deprecation warning for Active Record after_callback / after_commit
373
-
374
- ## 4.2.0 (2016-05-31)
375
-
376
- ### Breaking Changes
377
-
378
- - None
379
-
380
- ### Added
381
-
382
- - [#808](https://github.com/airblade/paper_trail/pull/808) -
383
- Warn when destroy callback is set to :after with ActiveRecord 5
384
- option `belongs_to_required_by_default` set to `true`.
385
-
386
- ### Fixed
387
-
388
- - None
389
-
390
- ## 4.1.0 (2016-01-30)
391
-
392
- ### Known Issues
393
-
394
- - Version changesets now store ENUM values incorrectly (as nulls). Previously the values were stored as strings. This only affects Rails 4, not Rails 5. See [#926](https://github.com/airblade/paper_trail/pull/926)
395
-
396
- ### Breaking Changes
397
-
398
- - None
399
-
400
- ### Added
401
-
402
- - A way to control the order of AR callbacks.
403
- [#614](https://github.com/airblade/paper_trail/pull/614)
404
- - Added `unversioned_attributes` option to `reify`.
405
- [#579](https://github.com/airblade/paper_trail/pull/579)
406
-
407
- ### Fixed
408
-
409
- - None
410
-
411
- ## 4.0.2 (2016-01-19)
412
-
413
- ### Breaking Changes
414
-
415
- - None
416
-
417
- ### Added
418
-
419
- - None
420
-
421
- ### Fixed
422
-
423
- - [#696](https://github.com/airblade/paper_trail/issues/696) /
424
- [#697](https://github.com/airblade/paper_trail/pull/697)
425
- Bind JSON query parameters in `where_object` and `where_object_changes`.
426
-
427
- ## 4.0.1 (2015-12-14)
428
-
429
- ### Breaking Changes
430
-
431
- - None
432
-
433
- ### Added
434
-
435
- - None
436
-
437
- ### Fixed
438
-
439
- - [#636](https://github.com/airblade/paper_trail/issues/636) -
440
- Should compile assets without a db connection
441
- - [#589](https://github.com/airblade/paper_trail/pull/589) /
442
- [#588](https://github.com/airblade/paper_trail/issues/588) -
443
- Fixes timestamp for "create" versions
444
-
445
- ## 4.0.0 (2015-07-30)
446
-
447
- This major release adds JSON column support in PostgreSQL, limited support for
448
- versioning associations, various new configuration options, and a year's worth
449
- of bug fixes. Thanks to everyone who helped test the two betas and two release
450
- candidates.
451
-
452
- ### Breaking Changes
453
-
454
- - Using a Rails initializer to reopen PaperTrail::Version or otherwise extend
455
- PaperTrail is no longer recommended. An alternative is described in the
456
- readme. See https://github.com/airblade/paper_trail/pull/557 and
457
- https://github.com/airblade/paper_trail/pull/492.
458
- - If you depend on the `RSpec` or `Cucumber` helpers, you must
459
- [require them in your test helper](https://github.com/airblade/paper_trail#testing).
460
- - [#566](https://github.com/airblade/paper_trail/pull/566) - Removed deprecated
461
- methods `paper_trail_on` and `paper_trail_off`. Use `paper_trail_on!` and
462
- `paper_trail_off!` instead.
463
- - [#458](https://github.com/airblade/paper_trail/pull/458) - Version metadata
464
- (the `:meta` option) from AR attributes for `create` events will now save the
465
- current value instead of `nil`.
466
- - [#391](https://github.com/airblade/paper_trail/issues/391) - `object_changes`
467
- value should dump to `YAML` as a normal `Hash` instead of an
468
- `ActiveSupport::HashWithIndifferentAccess`.
469
- - [#375](https://github.com/airblade/paper_trail/pull/375) /
470
- [#374](https://github.com/airblade/paper_trail/issues/374) /
471
- [#354](https://github.com/airblade/paper_trail/issues/354) /
472
- [#131](https://github.com/airblade/paper_trail/issues/131) -
473
- Versions are now saved with an `after_` callback, instead of a `before_`
474
- callback. This ensures that the timestamp field for a version matches the
475
- corresponding timestamp in the model.
476
- - `3da1f104` - `PaperTrail.config` and `PaperTrail.configure` are now
477
- identical: both return the `PaperTrail::Config` instance and also
478
- yield it if a block is provided.
479
-
480
- ### Added
481
-
482
- - [#525](https://github.com/airblade/paper_trail/issues/525) /
483
- [#512](https://github.com/airblade/paper_trail/pull/512) -
484
- Support for virtual accessors and redefined setter and getter methods.
485
- - [#518](https://github.com/airblade/paper_trail/pull/518) - Support for
486
- querying against PostgreSQL's
487
- [`JSON` and `JSONB` column types](http://www.postgresql.org/docs/9.4/static/datatype-json.html)
488
- via `PaperTrail::VersionConcern#where_object` and
489
- `PaperTrail::VersionConcern#where_object_changes`
490
- - [#507](https://github.com/airblade/paper_trail/pull/507) -
491
- New option: `:save_changes` controls whether or not to save changes to the
492
- `object_changes` column (if it exists).
493
- - [#500](https://github.com/airblade/paper_trail/pull/500) - Support for
494
- passing an empty array to the `on` option (`on: []`) to disable all
495
- automatic versioning.
496
- - [#494](https://github.com/airblade/paper_trail/issues/494) - The install
497
- generator will warn the user if the migration they are attempting to
498
- generate already exists.
499
- - [#484](https://github.com/airblade/paper_trail/pull/484) - Support for
500
- [PostgreSQL's `JSONB` Type](http://www.postgresql.org/docs/9.4/static/datatype-json.html)
501
- for storing `object` and `object_changes`.
502
- - [#439](https://github.com/airblade/paper_trail/pull/439) /
503
- [#12](https://github.com/airblade/paper_trail/issues/12) -
504
- Support for versioning associations (has many, has one, etc.) one level deep.
505
- - [#420](https://github.com/airblade/paper_trail/issues/420) - Add
506
- `VersionConcern#where_object_changes` instance method; acts as a helper for
507
- querying against the `object_changes` column in versions table.
508
- - [#416](https://github.com/airblade/paper_trail/issues/416) - Added a
509
- `config` option for enabling/disabling utilization of
510
- `serialized_attributes` for `ActiveRecord`, necessary because
511
- `serialized_attributes` has been deprecated in `ActiveRecord` version `4.2`
512
- and will be removed in version `5.0`
513
- - [#399](https://github.com/airblade/paper_trail/pull/399) - Add `:dup`
514
- argument for options hash to `reify` which forces a new model instance.
515
- - [#394](https://github.com/airblade/paper_trail/pull/394) - Add RSpec matcher
516
- `have_a_version_with` for easier testing.
517
- - [#347](https://github.com/airblade/paper_trail/pull/347) - Autoload
518
- `ActiveRecord` models in via a `Rails::Engine` when the gem is used with
519
- `Rails`.
520
-
521
- ### Fixed
522
-
523
- - [#563](https://github.com/airblade/paper_trail/pull/563) - Fixed a bug in
524
- `touch_with_version` so that it will still create a version even when the
525
- `on` option is, e.g. `[:create]`.
526
- - [#541](https://github.com/airblade/paper_trail/pull/541) -
527
- `PaperTrail.config.enabled` should be Thread Safe
528
- - [#451](https://github.com/airblade/paper_trail/issues/451) - Fix `reify`
529
- method in context of model where the base class has a default scope, and the
530
- live instance is not scoped within that default scope.
531
- - [#440](https://github.com/airblade/paper_trail/pull/440) - `versions`
532
- association should clear/reload after a transaction rollback.
533
- - [#438](https://github.com/airblade/paper_trail/issues/438) -
534
- `ModelKlass.paper_trail_enabled_for_model?` should return `false` if
535
- `has_paper_trail` has not been declared on the class.
536
- - [#404](https://github.com/airblade/paper_trail/issues/404) /
537
- [#428](https://github.com/airblade/paper_trail/issues/428) -
538
- `model_instance.dup` does not need to be invoked when examining what the
539
- instance looked like before changes were persisted, which avoids issues if a
540
- 3rd party has overriden the `dup` behavior. Also fixes errors occuring when
541
- a user attempts to update the inheritance column on an STI model instance in
542
- `ActiveRecord` 4.1.x
543
- - [#427](https://github.com/airblade/paper_trail/pull/427) - Fix `reify`
544
- method in context of model where a column has been removed.
545
- - [#414](https://github.com/airblade/paper_trail/issues/414) - Fix
546
- functionality `ignore` argument to `has_paper_trail` in `ActiveRecord` 4.
547
- - [#413](https://github.com/airblade/paper_trail/issues/413) - Utilize
548
- [RequestStore](https://github.com/steveklabnik/request_store) to ensure that
549
- the `PaperTrail.whodunnit` is set in a thread safe manner within Rails and
550
- Sinatra.
551
- - [#381](https://github.com/airblade/paper_trail/issues/381) - Fix `irb`
552
- warning: `can't alias context from irb_context`. `Rspec` and `Cucumber`
553
- helpers should not be loaded by default, regardless of whether those
554
- libraries are loaded.
555
- - [#248](https://github.com/airblade/paper_trail/issues/248) - In MySQL, to
556
- prevent truncation, generated migrations now use `longtext` instead of `text`.
557
- - Methods handling serialized attributes should fallback to the currently set
558
- Serializer instead of always falling back to `PaperTrail::Serializers::YAML`.
559
-
560
- ### Deprecated
561
-
562
- - [#479](https://github.com/airblade/paper_trail/issues/479) - Deprecated
563
- `originator` method, use `paper_trail_originator`.
564
-
565
- ## 3.0.9
566
-
567
- - [#479](https://github.com/airblade/paper_trail/issues/479) - Deprecated
568
- `originator` method in favor of `paper_trail_originator` Deprecation warning
569
- informs users that the `originator` of the methods will be removed in
570
- version `4.0`. (Backported from v4)
571
- - Updated deprecation warnings for `Model.paper_trail_on` and
572
- `Model.paper_trail_off` to have display correct version number the methods
573
- will be removed (`4.0`)
574
-
575
- ## 3.0.8
576
-
577
- - [#525](https://github.com/airblade/paper_trail/issues/525) / [#512](https://github.com/airblade/paper_trail/pull/512) -
578
- Support for virtual accessors and redefined setter and getter methods.
579
-
580
- ## 3.0.7
581
-
582
- - [#404](https://github.com/airblade/paper_trail/issues/404) / [#428](https://github.com/airblade/paper_trail/issues/428) -
583
- Fix errors occuring when a user attempts to update the inheritance column on an STI model instance in `ActiveRecord` 4.1.x
584
-
585
- ## 3.0.6
586
-
587
- - [#414](https://github.com/airblade/paper_trail/issues/414) - Backport fix for `ignore` argument to `has_paper_trail` in
588
- `ActiveRecord` 4.
589
-
590
- ## 3.0.5
591
-
592
- - [#401](https://github.com/airblade/paper_trail/issues/401) / [#406](https://github.com/airblade/paper_trail/issues/406) -
593
- `PaperTrail::Version` class is not loaded via a `Rails::Engine`, even when the gem is used within Rails. This feature has
594
- will be re-introduced in version `4.0`.
595
- - [#398](https://github.com/airblade/paper_trail/pull/398) - Only require the `RSpec` helper if `RSpec::Core` is required.
596
-
597
- ## 3.0.3
598
- *This version was yanked from RubyGems and has been replaced by version `3.0.5`, which is almost identical, but does not eager load
599
- in the `PaperTrail::Version` class through a `Rails::Engine` when the gem is used on Rails since it was causing issues for some users.*
600
-
601
- - [#386](https://github.com/airblade/paper_trail/issues/386) - Fix eager loading of `versions` association with custom class name
602
- in `ActiveRecord` 4.1.
603
- - [#384](https://github.com/airblade/paper_trail/issues/384) - Fix `VersionConcern#originator` instance method.
604
- - [#383](https://github.com/airblade/paper_trail/pull/383) - Make gem compatible with `ActiveRecord::Enum` (available in `ActiveRecord` 4.1+).
605
- - [#380](https://github.com/airblade/paper_trail/pull/380) / [#377](https://github.com/airblade/paper_trail/issues/377) -
606
- Add `VersionConcern#where_object` instance method; acts as a helper for querying against the `object` column in versions table.
607
- - [#373](https://github.com/airblade/paper_trail/pull/373) - Fix default sort order for the `versions` association in `ActiveRecord` 4.1.
608
- - [#372](https://github.com/airblade/paper_trail/pull/372) - Use [Arel](https://github.com/rails/arel) for SQL construction.
609
- - [#365](https://github.com/airblade/paper_trail/issues/365) - `VersionConcern#version_at` should return `nil` when receiving a timestamp
610
- that occured after the object was destroyed.
611
- - Expand `PaperTrail::VERSION` into a module, mimicking the form used by Rails to give it some additional modularity & versatility.
612
- - Fixed `VersionConcern#index` instance method so that it conforms to using the primary key for ordering when possible.
613
-
614
- ## 3.0.2
615
-
616
- - [#357](https://github.com/airblade/paper_trail/issues/357) - If a `Version` instance is reified and then persisted at that state,
617
- it's timestamp attributes for update should still get `touch`ed.
618
- - [#351](https://github.com/airblade/paper_trail/pull/351) / [#352](https://github.com/airblade/paper_trail/pull/352) -
619
- `PaperTrail::Rails::Controller` should hook into all controller types, and should not get loaded unless `ActionController` is.
620
- - [#346](https://github.com/airblade/paper_trail/pull/346) - `user_for_paper_trail` method should accommodate different types
621
- for return values from `current_user` method.
622
- - [#344](https://github.com/airblade/paper_trail/pull/344) - Gem is now tested against `MySQL` and `PostgreSQL` in addition to `SQLite`.
623
- - [#317](https://github.com/airblade/paper_trail/issues/317) / [#314](https://github.com/airblade/paper_trail/issues/314) -
624
- `versions` should default to ordering via the primary key if it is an integer to avoid timestamp comparison issues.
625
- - `PaperTrail::Cleaner.clean_versions!` should group versions by `PaperTrail.timestamp_field` when deciding which ones to
626
- keep / destroy, instead of always grouping by the `created_at` field.
627
- - If a `Version` instance is reified and then persisted at that state, it's source version
628
- (`model_instance#version_association_name`, usually `model_instance#version`) will get cleared since persisting it causes it to
629
- become the live instance.
630
- - If `destroy` actions are tracked for a versioned model, invoking `destroy` on the model will cause the corresponding version that
631
- gets generated to be assigned as the source version (`model_instance#version_association_name`, usually `model_instance#version`).
632
-
633
- ## 3.0.1
634
-
635
- - [#340](https://github.com/airblade/paper_trail/issues/340) - Prevent potential error encountered when using the `InstallGenerator`
636
- with Rails `4.1.0.rc1`.
637
- - [#334](https://github.com/airblade/paper_trail/pull/334) - Add small-scope `whodunnit` method to `PaperTrail::Model::InstanceMethods`.
638
- - [#329](https://github.com/airblade/paper_trail/issues/329) - Add `touch_with_version` method to `PaperTrail::Model::InstanceMethods`,
639
- to allow for generating a version while `touch`ing a model.
640
- - [#328](https://github.com/airblade/paper_trail/pull/328) / [#326](https://github.com/airblade/paper_trail/issues/326) /
641
- [#307](https://github.com/airblade/paper_trail/issues/307) - `Model.paper_trail_enabled_for_model?` and
642
- `model_instance.without_versioning` is now thread-safe.
643
- - [#316](https://github.com/airblade/paper_trail/issues/316) - `user_for_paper_trail` should default to `current_user.try(:id)`
644
- instead of `current_user` (if `current_user` is defined).
645
- - [#313](https://github.com/airblade/paper_trail/pull/313) - Make the `Rails::Controller` helper compatible with
646
- `ActionController::API` for compatibility with the [`rails-api`](https://github.com/rails-api/rails-api) gem.
647
- - [#312](https://github.com/airblade/paper_trail/issues/312) - Fix RSpec `with_versioning` class level helper method.
648
- - `model_instance.without_versioning` now yields the `model_instance`, enabling syntax like this:
649
- `model_instance.without_versioning { |obj| obj.update_attributes(:name => 'value') }`.
650
- - Deprecated `Model.paper_trail_on` and `Model.paper_trail_off` in favor of bang versions of the methods.
651
- Deprecation warning informs users that the non-bang versions of the methods will be removed in version `4.0`
652
-
653
- ## 3.0.0
654
-
655
- - [#305](https://github.com/airblade/paper_trail/pull/305) - `PaperTrail::VERSION` should be loaded at runtime.
656
- - [#295](https://github.com/airblade/paper_trail/issues/295) - Explicitly specify table name for version class when
657
- querying attributes. Prevents `AmbiguousColumn` errors on certain `JOIN` statements.
658
- - [#289](https://github.com/airblade/paper_trail/pull/289) - Use `ActiveSupport::Concern` for implementation of base functionality on
659
- `PaperTrail::Version` class. Increases flexibility and makes it easier to use custom version classes with multiple `ActiveRecord` connections.
660
- - [#288](https://github.com/airblade/paper_trail/issues/288) - Change all scope declarations to class methods on the `PaperTrail::Version`
661
- class. Fixes usability when `PaperTrail::Version.abstract_class? == true`.
662
- - [#287](https://github.com/airblade/paper_trail/issues/287) - Support for
663
- [PostgreSQL's JSON Type](http://www.postgresql.org/docs/9.2/static/datatype-json.html) for storing `object` and `object_changes`.
664
- - [#281](https://github.com/airblade/paper_trail/issues/281) - `Rails::Controller` helper will return `false` for the
665
- `paper_trail_enabled_for_controller` method if `PaperTrail.enabled? == false`.
666
- - [#280](https://github.com/airblade/paper_trail/pull/280) - Don't track virtual timestamp attributes.
667
- - [#278](https://github.com/airblade/paper_trail/issues/278) / [#272](https://github.com/airblade/paper_trail/issues/272) -
668
- Make RSpec and Cucumber helpers usable with [Spork](https://github.com/sporkrb/spork) and [Zeus](https://github.com/burke/zeus).
669
- - [#273](https://github.com/airblade/paper_trail/pull/273) - Make the `only` and `ignore` options accept `Hash` arguments;
670
- allows for conditional tracking.
671
- - [#264](https://github.com/airblade/paper_trail/pull/264) - Allow unwrapped symbol to be passed in to the `on` option.
672
- - [#224](https://github.com/airblade/paper_trail/issues/224)/[#236](https://github.com/airblade/paper_trail/pull/236) -
673
- Fixed compatibility with [ActsAsTaggableOn](https://github.com/mbleigh/acts-as-taggable-on).
674
- - [#235](https://github.com/airblade/paper_trail/pull/235) - Dropped unnecessary secondary sort on `versions` association.
675
- - [#216](https://github.com/airblade/paper_trail/pull/216) - Added helper & extension for [RSpec](https://github.com/rspec/rspec),
676
- and helper for [Cucumber](http://cukes.info).
677
- - [#212](https://github.com/airblade/paper_trail/pull/212) - Added `PaperTrail::Cleaner` module, useful for discarding draft versions.
678
- - [#207](https://github.com/airblade/paper_trail/issues/207) - Versions for `'create'` events are now created with `create!` instead of
679
- `create` so that an exception gets raised if it is appropriate to do so.
680
- - [#199](https://github.com/airblade/paper_trail/pull/199) - Rails 4 compatibility.
681
- - [#165](https://github.com/airblade/paper_trail/pull/165) - Namespaced the `Version` class under the `PaperTrail` module.
682
- - [#119](https://github.com/airblade/paper_trail/issues/119) - Support for [Sinatra](http://www.sinatrarb.com/); decoupled gem from `Rails`.
683
- - Renamed the default serializers from `PaperTrail::Serializers::Yaml` and `PaperTrail::Serializers::Json` to the capitalized forms,
684
- `PaperTrail::Serializers::YAML` and `PaperTrail::Serializers::JSON`.
685
- - Removed deprecated `set_whodunnit` method from Rails Controller scope.
686
-
687
- ## 2.7.2
688
-
689
- - [#228](https://github.com/airblade/paper_trail/issues/228) - Refactored default `user_for_paper_trail` method implementation
690
- so that `current_user` only gets invoked if it is defined.
691
- - [#219](https://github.com/airblade/paper_trail/pull/219) - Fixed issue where attributes stored with `nil` value might not get
692
- reified properly depending on the way the serializer worked.
693
- - [#213](https://github.com/airblade/paper_trail/issues/213) - Added a `version_limit` option to the `PaperTrail::Config` options
694
- that can be used to restrict the number of versions PaperTrail will store per object instance.
695
- - [#187](https://github.com/airblade/paper_trail/pull/187) - Confirmed JRuby support.
696
- - [#174](https://github.com/airblade/paper_trail/pull/174) - The `event` field on the versions table can now be customized.
697
-
698
- ## 2.7.1
699
-
700
- - [#206](https://github.com/airblade/paper_trail/issues/206) - Fixed Ruby 1.8.7 compatibility for tracking `object_changes`.
701
- - [#200](https://github.com/airblade/paper_trail/issues/200) - Fixed `next_version` method so that it returns the live model
702
- when called on latest reified version of a model prior to the live model.
703
- - [#197](https://github.com/airblade/paper_trail/issues/197) - PaperTrail now falls back on using YAML for serialization of
704
- serialized model attributes for storage in the `object` and `object_changes` columns in the `Version` table. This fixes
705
- compatibility for `Rails 3.0.x` for projects that employ the `serialize` declaration on a model.
706
- - [#194](https://github.com/airblade/paper_trail/issues/194) - A JSON serializer is now included in the gem.
707
- - [#192](https://github.com/airblade/paper_trail/pull/192) - `object_changes` should store serialized representation of serialized
708
- attributes for `create` actions (in addition to `update` actions, which had already been patched by
709
- [#180](https://github.com/airblade/paper_trail/pull/180)).
710
- - [#190](https://github.com/airblade/paper_trail/pull/190) - Fixed compatibility with
711
- [SerializedAttributes](https://github.com/technoweenie/serialized_attributes) gem.
712
- - [#189](https://github.com/airblade/paper_trail/pull/189) - Provided support for a `configure` block initializer.
713
- - Added `setter` method for the `serializer` config option.
714
-
715
- ## 2.7.0
716
-
717
- - [#183](https://github.com/airblade/paper_trail/pull/183) - Fully qualify the `Version` class to help prevent
718
- namespace resolution errors within other gems / plugins.
719
- - [#180](https://github.com/airblade/paper_trail/pull/180) - Store serialized representation of serialized attributes
720
- on the `object` and `object_changes` columns in the `Version` table.
721
- - [#164](https://github.com/airblade/paper_trail/pull/164) - Allow usage of custom serializer for storage of object attributes.
722
-
723
- ## 2.6.4
724
-
725
- - [#181](https://github.com/airblade/paper_trail/issues/181)/[#182](https://github.com/airblade/paper_trail/pull/182) -
726
- Controller metadata methods should only be evaluated when `paper_trail_enabled_for_controller == true`.
727
- - [#177](https://github.com/airblade/paper_trail/issues/177)/[#178](https://github.com/airblade/paper_trail/pull/178) -
728
- Factored out `version_key` into it's own method to prevent `ConnectionNotEstablished` error from getting thrown in
729
- instances where `has_paper_trail` is declared on class prior to ActiveRecord establishing a connection.
730
- - [#176](https://github.com/airblade/paper_trail/pull/176) - Force metadata calls for attributes to use current value
731
- if attribute value is changing.
732
- - [#173](https://github.com/airblade/paper_trail/pull/173) - Update link to [diff-lcs](https://github.com/halostatue/diff-lcs).
733
- - [#172](https://github.com/airblade/paper_trail/pull/172) - Save `object_changes` on creation.
734
- - [#168](https://github.com/airblade/paper_trail/pull/168) - Respect conditional `:if` or `:unless` arguments to the
735
- `has_paper_trail` method for `destroy` events.
736
- - [#167](https://github.com/airblade/paper_trail/pull/167) - Fix `originator` method so that it works with subclasses and STI.
737
- - [#160](https://github.com/airblade/paper_trail/pull/160) - Fixed failing tests and resolved out of date dependency issues.
738
- - [#157](https://github.com/airblade/paper_trail/pull/157) - Refactored `class_attribute` names on the `ClassMethods` module
739
- for names that are not obviously pertaining to PaperTrail to prevent method name collision.