paper_trail 5.2.3 → 11.0.0

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 (198) hide show
  1. checksums.yaml +5 -5
  2. data/lib/generators/paper_trail/install/USAGE +3 -0
  3. data/lib/generators/paper_trail/install/install_generator.rb +75 -0
  4. data/lib/generators/paper_trail/{templates/add_object_changes_to_versions.rb → install/templates/add_object_changes_to_versions.rb.erb} +1 -1
  5. data/lib/generators/paper_trail/install/templates/create_versions.rb.erb +36 -0
  6. data/lib/generators/paper_trail/migration_generator.rb +38 -0
  7. data/lib/generators/paper_trail/update_item_subtype/USAGE +4 -0
  8. data/lib/generators/paper_trail/update_item_subtype/templates/update_versions_for_item_subtype.rb.erb +85 -0
  9. data/lib/generators/paper_trail/update_item_subtype/update_item_subtype_generator.rb +17 -0
  10. data/lib/paper_trail.rb +82 -130
  11. data/lib/paper_trail/attribute_serializers/attribute_serializer_factory.rb +27 -0
  12. data/lib/paper_trail/attribute_serializers/cast_attribute_serializer.rb +15 -44
  13. data/lib/paper_trail/attribute_serializers/object_attribute.rb +2 -0
  14. data/lib/paper_trail/attribute_serializers/object_changes_attribute.rb +2 -0
  15. data/lib/paper_trail/cleaner.rb +3 -1
  16. data/lib/paper_trail/compatibility.rb +51 -0
  17. data/lib/paper_trail/config.rb +11 -49
  18. data/lib/paper_trail/events/base.rb +323 -0
  19. data/lib/paper_trail/events/create.rb +32 -0
  20. data/lib/paper_trail/events/destroy.rb +42 -0
  21. data/lib/paper_trail/events/update.rb +60 -0
  22. data/lib/paper_trail/frameworks/active_record.rb +2 -1
  23. data/lib/paper_trail/frameworks/active_record/models/paper_trail/version.rb +8 -3
  24. data/lib/paper_trail/frameworks/cucumber.rb +5 -3
  25. data/lib/paper_trail/frameworks/rails.rb +2 -0
  26. data/lib/paper_trail/frameworks/rails/controller.rb +33 -43
  27. data/lib/paper_trail/frameworks/rails/engine.rb +34 -1
  28. data/lib/paper_trail/frameworks/rspec.rb +17 -4
  29. data/lib/paper_trail/frameworks/rspec/helpers.rb +2 -0
  30. data/lib/paper_trail/has_paper_trail.rb +22 -310
  31. data/lib/paper_trail/model_config.rb +157 -109
  32. data/lib/paper_trail/queries/versions/where_object.rb +65 -0
  33. data/lib/paper_trail/queries/versions/where_object_changes.rb +75 -0
  34. data/lib/paper_trail/record_history.rb +3 -9
  35. data/lib/paper_trail/record_trail.rb +169 -319
  36. data/lib/paper_trail/reifier.rb +53 -374
  37. data/lib/paper_trail/request.rb +166 -0
  38. data/lib/paper_trail/serializers/json.rb +9 -10
  39. data/lib/paper_trail/serializers/yaml.rb +15 -28
  40. data/lib/paper_trail/type_serializers/postgres_array_serializer.rb +48 -0
  41. data/lib/paper_trail/version_concern.rb +160 -155
  42. data/lib/paper_trail/version_number.rb +12 -4
  43. metadata +77 -372
  44. data/.github/CONTRIBUTING.md +0 -109
  45. data/.github/ISSUE_TEMPLATE.md +0 -13
  46. data/.gitignore +0 -23
  47. data/.rspec +0 -2
  48. data/.rubocop.yml +0 -99
  49. data/.rubocop_todo.yml +0 -22
  50. data/.travis.yml +0 -41
  51. data/Appraisals +0 -38
  52. data/CHANGELOG.md +0 -560
  53. data/Gemfile +0 -2
  54. data/MIT-LICENSE +0 -20
  55. data/README.md +0 -1654
  56. data/Rakefile +0 -30
  57. data/doc/bug_report_template.rb +0 -69
  58. data/doc/warning_about_not_setting_whodunnit.md +0 -32
  59. data/gemfiles/ar3.gemfile +0 -19
  60. data/gemfiles/ar4.gemfile +0 -8
  61. data/gemfiles/ar5.gemfile +0 -9
  62. data/lib/generators/paper_trail/USAGE +0 -2
  63. data/lib/generators/paper_trail/default_initializer.rb +0 -0
  64. data/lib/generators/paper_trail/install_generator.rb +0 -57
  65. data/lib/generators/paper_trail/templates/add_transaction_id_column_to_versions.rb +0 -13
  66. data/lib/generators/paper_trail/templates/create_version_associations.rb +0 -22
  67. data/lib/generators/paper_trail/templates/create_versions.rb +0 -80
  68. data/lib/paper_trail/attribute_serializers/legacy_active_record_shim.rb +0 -48
  69. data/lib/paper_trail/frameworks/active_record/models/paper_trail/version_association.rb +0 -11
  70. data/lib/paper_trail/frameworks/sinatra.rb +0 -40
  71. data/lib/paper_trail/version_association_concern.rb +0 -17
  72. data/paper_trail.gemspec +0 -56
  73. data/spec/generators/install_generator_spec.rb +0 -66
  74. data/spec/generators/paper_trail/templates/create_versions_spec.rb +0 -51
  75. data/spec/models/animal_spec.rb +0 -36
  76. data/spec/models/boolit_spec.rb +0 -48
  77. data/spec/models/callback_modifier_spec.rb +0 -96
  78. data/spec/models/car_spec.rb +0 -13
  79. data/spec/models/custom_primary_key_record_spec.rb +0 -18
  80. data/spec/models/fluxor_spec.rb +0 -17
  81. data/spec/models/gadget_spec.rb +0 -68
  82. data/spec/models/joined_version_spec.rb +0 -47
  83. data/spec/models/json_version_spec.rb +0 -102
  84. data/spec/models/kitchen/banana_spec.rb +0 -14
  85. data/spec/models/not_on_update_spec.rb +0 -22
  86. data/spec/models/post_with_status_spec.rb +0 -50
  87. data/spec/models/skipper_spec.rb +0 -46
  88. data/spec/models/thing_spec.rb +0 -11
  89. data/spec/models/truck_spec.rb +0 -5
  90. data/spec/models/vehicle_spec.rb +0 -5
  91. data/spec/models/version_spec.rb +0 -272
  92. data/spec/models/widget_spec.rb +0 -343
  93. data/spec/modules/paper_trail_spec.rb +0 -27
  94. data/spec/modules/version_concern_spec.rb +0 -31
  95. data/spec/modules/version_number_spec.rb +0 -43
  96. data/spec/paper_trail/config_spec.rb +0 -33
  97. data/spec/paper_trail_spec.rb +0 -79
  98. data/spec/rails_helper.rb +0 -34
  99. data/spec/requests/articles_spec.rb +0 -34
  100. data/spec/spec_helper.rb +0 -114
  101. data/spec/support/alt_db_init.rb +0 -54
  102. data/test/custom_json_serializer.rb +0 -13
  103. data/test/dummy/Rakefile +0 -7
  104. data/test/dummy/app/controllers/application_controller.rb +0 -33
  105. data/test/dummy/app/controllers/articles_controller.rb +0 -20
  106. data/test/dummy/app/controllers/test_controller.rb +0 -5
  107. data/test/dummy/app/controllers/widgets_controller.rb +0 -32
  108. data/test/dummy/app/helpers/application_helper.rb +0 -2
  109. data/test/dummy/app/models/animal.rb +0 -6
  110. data/test/dummy/app/models/article.rb +0 -24
  111. data/test/dummy/app/models/authorship.rb +0 -5
  112. data/test/dummy/app/models/bar_habtm.rb +0 -4
  113. data/test/dummy/app/models/book.rb +0 -9
  114. data/test/dummy/app/models/boolit.rb +0 -4
  115. data/test/dummy/app/models/callback_modifier.rb +0 -45
  116. data/test/dummy/app/models/car.rb +0 -3
  117. data/test/dummy/app/models/cat.rb +0 -2
  118. data/test/dummy/app/models/chapter.rb +0 -9
  119. data/test/dummy/app/models/citation.rb +0 -5
  120. data/test/dummy/app/models/custom_primary_key_record.rb +0 -13
  121. data/test/dummy/app/models/customer.rb +0 -4
  122. data/test/dummy/app/models/document.rb +0 -4
  123. data/test/dummy/app/models/dog.rb +0 -2
  124. data/test/dummy/app/models/editor.rb +0 -4
  125. data/test/dummy/app/models/editorship.rb +0 -5
  126. data/test/dummy/app/models/elephant.rb +0 -3
  127. data/test/dummy/app/models/fluxor.rb +0 -3
  128. data/test/dummy/app/models/foo_habtm.rb +0 -5
  129. data/test/dummy/app/models/foo_widget.rb +0 -2
  130. data/test/dummy/app/models/fruit.rb +0 -5
  131. data/test/dummy/app/models/gadget.rb +0 -3
  132. data/test/dummy/app/models/kitchen/banana.rb +0 -5
  133. data/test/dummy/app/models/legacy_widget.rb +0 -4
  134. data/test/dummy/app/models/line_item.rb +0 -4
  135. data/test/dummy/app/models/not_on_update.rb +0 -4
  136. data/test/dummy/app/models/order.rb +0 -5
  137. data/test/dummy/app/models/paragraph.rb +0 -5
  138. data/test/dummy/app/models/person.rb +0 -38
  139. data/test/dummy/app/models/post.rb +0 -3
  140. data/test/dummy/app/models/post_with_status.rb +0 -8
  141. data/test/dummy/app/models/protected_widget.rb +0 -3
  142. data/test/dummy/app/models/quotation.rb +0 -5
  143. data/test/dummy/app/models/section.rb +0 -6
  144. data/test/dummy/app/models/skipper.rb +0 -6
  145. data/test/dummy/app/models/song.rb +0 -41
  146. data/test/dummy/app/models/thing.rb +0 -3
  147. data/test/dummy/app/models/translation.rb +0 -4
  148. data/test/dummy/app/models/truck.rb +0 -4
  149. data/test/dummy/app/models/vehicle.rb +0 -4
  150. data/test/dummy/app/models/whatchamajigger.rb +0 -4
  151. data/test/dummy/app/models/widget.rb +0 -16
  152. data/test/dummy/app/models/wotsit.rb +0 -8
  153. data/test/dummy/app/versions/custom_primary_key_record_version.rb +0 -3
  154. data/test/dummy/app/versions/joined_version.rb +0 -6
  155. data/test/dummy/app/versions/json_version.rb +0 -3
  156. data/test/dummy/app/versions/kitchen/banana_version.rb +0 -5
  157. data/test/dummy/app/versions/post_version.rb +0 -3
  158. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  159. data/test/dummy/config.ru +0 -4
  160. data/test/dummy/config/application.rb +0 -80
  161. data/test/dummy/config/boot.rb +0 -10
  162. data/test/dummy/config/database.mysql.yml +0 -19
  163. data/test/dummy/config/database.postgres.yml +0 -15
  164. data/test/dummy/config/database.sqlite.yml +0 -15
  165. data/test/dummy/config/environment.rb +0 -5
  166. data/test/dummy/config/environments/development.rb +0 -41
  167. data/test/dummy/config/environments/production.rb +0 -74
  168. data/test/dummy/config/environments/test.rb +0 -51
  169. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -9
  170. data/test/dummy/config/initializers/inflections.rb +0 -10
  171. data/test/dummy/config/initializers/mime_types.rb +0 -5
  172. data/test/dummy/config/initializers/paper_trail.rb +0 -9
  173. data/test/dummy/config/initializers/secret_token.rb +0 -9
  174. data/test/dummy/config/initializers/session_store.rb +0 -8
  175. data/test/dummy/config/locales/en.yml +0 -5
  176. data/test/dummy/config/routes.rb +0 -4
  177. data/test/dummy/db/migrate/20110208155312_set_up_test_tables.rb +0 -361
  178. data/test/dummy/db/schema.rb +0 -288
  179. data/test/dummy/script/rails +0 -8
  180. data/test/functional/controller_test.rb +0 -90
  181. data/test/functional/enabled_for_controller_test.rb +0 -28
  182. data/test/functional/modular_sinatra_test.rb +0 -46
  183. data/test/functional/sinatra_test.rb +0 -51
  184. data/test/functional/thread_safety_test.rb +0 -46
  185. data/test/test_helper.rb +0 -127
  186. data/test/time_travel_helper.rb +0 -1
  187. data/test/unit/associations_test.rb +0 -1016
  188. data/test/unit/cleaner_test.rb +0 -188
  189. data/test/unit/inheritance_column_test.rb +0 -43
  190. data/test/unit/model_test.rb +0 -1489
  191. data/test/unit/protected_attrs_test.rb +0 -52
  192. data/test/unit/serializer_test.rb +0 -119
  193. data/test/unit/serializers/json_test.rb +0 -95
  194. data/test/unit/serializers/mixin_json_test.rb +0 -37
  195. data/test/unit/serializers/mixin_yaml_test.rb +0 -53
  196. data/test/unit/serializers/yaml_test.rb +0 -54
  197. data/test/unit/timestamp_test.rb +0 -41
  198. data/test/unit/version_test.rb +0 -119
@@ -1,109 +0,0 @@
1
- # Contributing
2
-
3
- Thanks for your interest in PaperTrail!
4
-
5
- Ask usage questions on Stack Overflow:
6
- https://stackoverflow.com/tags/paper-trail-gem
7
-
8
- **Please do not use github issues to ask usage questions.**
9
-
10
- On github, we appreciate bug reports, feature
11
- suggestions, and especially pull requests.
12
-
13
- Thanks, and happy (paper) trails :)
14
-
15
- ## Reporting Bugs
16
-
17
- Please use our [bug report template][1].
18
-
19
- ## Development
20
-
21
- Install gems with `bundle exec appraisal install`.
22
-
23
- Testing is a little awkward because the test suite:
24
-
25
- 1. Supports three major versions of rails: 3, 4, 5
26
- 1. Contains a "dummy" rails app with three databases (test, foo, and bar)
27
- 1. Supports three different RDBMS': sqlite, mysql, and postgres
28
-
29
- Test against rails 3:
30
-
31
- ```
32
- bundle exec appraisal ar3 rake
33
- ```
34
-
35
- Run tests with sqlite:
36
-
37
- ```
38
- # Create the appropriate database config. file
39
- rm test/dummy/config/database.yml
40
- DB=sqlite bundle exec rake prepare
41
-
42
- # If this is the first test run ever, create databases
43
- cd test/dummy
44
- RAILS_ENV=test bundle exec rake db:setup
45
- RAILS_ENV=foo bundle exec rake db:setup
46
- RAILS_ENV=bar bundle exec rake db:setup
47
- cd ../..
48
-
49
- # Run tests
50
- DB=sqlite bundle exec rake
51
- ```
52
-
53
- Run tests with mysql:
54
-
55
- ```
56
- # Create the appropriate database config. file
57
- rm test/dummy/config/database.yml
58
- DB=mysql bundle exec rake prepare
59
-
60
- # If this is the first test run ever, create databases
61
- cd test/dummy
62
- RAILS_ENV=test bundle exec rake db:setup
63
- RAILS_ENV=foo bundle exec rake db:setup
64
- RAILS_ENV=bar bundle exec rake db:setup
65
- cd ../..
66
-
67
- # Run tests
68
- DB=mysql bundle exec rake
69
- ```
70
-
71
- Run tests with postgres:
72
-
73
- ```
74
- # Create the appropriate database config. file
75
- rm test/dummy/config/database.yml
76
- DB=postgres bundle exec rake prepare
77
-
78
- # If this is the first test run ever, create databases.
79
- # Unlike mysql, use create/migrate instead of setup.
80
- cd test/dummy
81
- DB=postgres RAILS_ENV=test bundle exec rake db:create
82
- DB=postgres RAILS_ENV=test bundle exec rake db:migrate
83
- DB=postgres RAILS_ENV=foo bundle exec rake db:create
84
- DB=postgres RAILS_ENV=foo bundle exec rake db:migrate
85
- DB=postgres RAILS_ENV=bar bundle exec rake db:create
86
- DB=postgres RAILS_ENV=bar bundle exec rake db:migrate
87
- cd ../..
88
-
89
- # Run tests
90
- DB=postgres bundle exec rake
91
- ```
92
-
93
- ### Releases
94
-
95
- 1. Set the version in lib/paper_trail/version_number.rb
96
- - Set PRE to nil unless it's a pre-release (beta, rc, etc.)
97
- 1. In the changelog,
98
- - Replace "Unreleased" with the date in iso-8601 format
99
- - Add a new "Unreleased" section
100
- 1. In the readme,
101
- - Update any other references to version number, including
102
- - Update version number(s) in the documentation links table
103
- 1. Commit
104
- 1. git tag -a -m "v5.0.0" "v5.0.0" # or whatever number
105
- 1. git push --tags origin master
106
- 1. gem build paper_trail.gemspec
107
- 1. gem push paper_trail-5.0.0.gem
108
-
109
- [1]: https://github.com/airblade/paper_trail/blob/master/doc/bug_report_template.rb
@@ -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
- test/dummy/config/database.yml
6
- test/dummy/db/*.sqlite3
7
- test/dummy/log/*
8
- test/dummy/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
@@ -1,99 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- # Please:
4
- #
5
- # - Comment any deviations from the Ruby Style Guide
6
- # - Alphabetize cops
7
- # - Only include permanent config; temporary goes in .rubocop_todo.yml
8
-
9
- AllCops:
10
- Exclude:
11
- - gemfiles/vendor/bundle/**/* # This dir only shows up on travis ¯\_(ツ)_/¯
12
- - test/dummy/db/schema.rb # Generated, out of our control
13
-
14
- # Set to lowest supported version
15
- TargetRubyVersion: 1.9
16
-
17
- # Migrations often contain long up/down methods, and extracting smaller methods
18
- # from these is of questionable value.
19
- Metrics/AbcSize:
20
- Exclude:
21
- - 'test/dummy/db/migrate/*'
22
-
23
- # The Ruby Style Guide recommends to "Limit lines to 80 characters."
24
- # (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
25
- # but 100 is also reasonable.
26
- Metrics/LineLength:
27
- Max: 100
28
-
29
- # The number of lines in a method is not a useful metric compared to `AbcSize`.
30
- # It's common to have very long methods (> 50 lines) which are quite simple. For
31
- # example, a method that returns a long string with only a few interpolations.
32
- Metrics/MethodLength:
33
- Enabled: false
34
-
35
- Style/AlignParameters:
36
- EnforcedStyle: with_fixed_indentation
37
-
38
- # Please use semantic style, e.g. `do` when there's a side-effect, else `{}`.
39
- # The semantic style is too nuanced to lint, so the cop is disabled.
40
- Style/BlockDelimiters:
41
- Enabled: false
42
-
43
- Style/DotPosition:
44
- EnforcedStyle: trailing
45
-
46
- # Use double negation wherever it would otherwise be impractical to convert
47
- # a value to an actual boolean.
48
- Style/DoubleNegation:
49
- Enabled: false
50
-
51
- # The decision of when to use a guard clause to improve readability is subtle,
52
- # and it's not clear that it can be linted. Certainly, the default
53
- # `MinBodyLength` of 1 can actually hurt readability.
54
- Style/GuardClause:
55
- MinBodyLength: 3
56
-
57
- # Use postfix (modifier) conditionals for one-liners, unless doing so would
58
- # exceed 60 characters.
59
- Style/IfUnlessModifier:
60
- MaxLineLength: 60
61
-
62
- # The Ruby Style Guide says:
63
- #
64
- # > Use \ instead of + or << to concatenate two string literals at line end.
65
- #
66
- # but in my experience the `\` style is rarely used and less readable. Please
67
- # concatenate multiline strings with `+` or use a HEREDOC.
68
- Style/LineEndConcatenation:
69
- Enabled: false
70
-
71
- # Using `module_function` instead of `extend self` would make the instance
72
- # methods in these modules private. That would be a breaking change, so these
73
- # modules are excluded. See discussion in:
74
- # - https://github.com/airblade/paper_trail/pull/756
75
- # - https://github.com/bbatsov/ruby-style-guide/issues/556
76
- Style/ModuleFunction:
77
- Exclude:
78
- - 'lib/paper_trail/serializers/json.rb'
79
- - 'lib/paper_trail/serializers/yaml.rb'
80
-
81
- Style/MultilineMethodCallIndentation:
82
- EnforcedStyle: indented
83
-
84
- Style/MultilineOperationIndentation:
85
- EnforcedStyle: indented
86
-
87
- Style/PredicateName:
88
- NameWhitelist: has_paper_trail
89
-
90
- # The Ruby Style Guide does not prescribe a particular quote character, only
91
- # that a project should pick one and be consistent. The decision has no
92
- # performance implications. Double quotes are slightly easier to read.
93
- Style/StringLiterals:
94
- EnforcedStyle: double_quotes
95
-
96
- # Use exactly one space on each side of an operator. Do not align operators
97
- # because it makes the code harder to edit, and makes lines unnecessarily long.
98
- Style/SpaceAroundOperators:
99
- AllowForAlignment: false
@@ -1,22 +0,0 @@
1
- # Remove these configuration records
2
- # one by one as the offenses are removed from the code base.
3
-
4
- Metrics/AbcSize:
5
- Max: 30 # Goal: 15
6
-
7
- Metrics/ClassLength:
8
- Max: 327
9
- Exclude:
10
- - test/**/*
11
-
12
- Metrics/CyclomaticComplexity:
13
- Max: 8 # Goal: 6
14
-
15
- Metrics/ModuleLength:
16
- Max: 317
17
-
18
- Metrics/PerceivedComplexity:
19
- Max: 10 # Goal: 7
20
-
21
- Style/FrozenStringLiteralComment:
22
- Enabled: false
@@ -1,41 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- rvm:
4
- - 2.3.1
5
- - 1.9.3
6
- - jruby-19mode
7
- env:
8
- global:
9
- - TRAVIS=true
10
- matrix:
11
- - DB=mysql
12
- - DB=postgres
13
- - DB=sqlite
14
-
15
- sudo: false
16
-
17
- before_script:
18
- - mysql --version
19
- - sh -c "if [ \"$DB\" = 'mysql' ]; then mysql -e 'create database paper_trail_test;'; fi"
20
- - sh -c "if [ \"$DB\" = 'mysql' ]; then mysql -e 'create database paper_trail_bar; '; fi"
21
- - sh -c "if [ \"$DB\" = 'mysql' ]; then mysql -e 'create database paper_trail_foo; '; fi"
22
- - psql --version
23
- - sh -c "if [ \"$DB\" = 'postgres' ]; then psql -c 'create database paper_trail_test;' -U postgres; fi"
24
- - sh -c "if [ \"$DB\" = 'postgres' ]; then psql -c 'create database paper_trail_bar;' -U postgres; fi"
25
- - sh -c "if [ \"$DB\" = 'postgres' ]; then psql -c 'create database paper_trail_foo;' -U postgres; fi"
26
-
27
- gemfile:
28
- - gemfiles/ar3.gemfile
29
- - gemfiles/ar4.gemfile
30
- - gemfiles/ar5.gemfile
31
-
32
- matrix:
33
- fast_finish: true
34
- exclude:
35
- - gemfile: gemfiles/ar5.gemfile
36
- rvm: 1.9.3
37
- - gemfile: gemfiles/ar5.gemfile
38
- rvm: jruby-19mode
39
-
40
- addons:
41
- postgresql: "9.4"
data/Appraisals DELETED
@@ -1,38 +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 "ar3" do
11
- gem "activerecord", "~> 3.2.22"
12
- gem "i18n", "~> 0.6.11"
13
- gem "request_store", "~> 1.1.0"
14
- gem "sinatra", "~> 1.4.6"
15
-
16
- group :development, :test do
17
- gem 'railties', '~> 3.2.22'
18
- gem 'test-unit', '~> 3.1.5'
19
- platforms :ruby do
20
- gem 'mysql2', '~> 0.3.20'
21
- end
22
- end
23
- end
24
-
25
- appraise "ar4" do
26
- gem "activerecord", "~> 4.2"
27
- gem "sinatra", "~> 1.4.6"
28
- end
29
-
30
- appraise "ar5" do
31
- gem "activerecord", "~> 5.0.0"
32
- gem "rspec-rails", "~> 3.5.1"
33
- gem 'rails-controller-testing'
34
-
35
- # The AR5 version of PaperTrail is not compatible with sinatra 2 yet.
36
- # Contributions welcome.
37
- # gem "sinatra", "2.0.0.beta2"
38
- end
@@ -1,560 +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
- ## 5.2.3 (2016-11-29)
7
-
8
- ### Breaking Changes
9
-
10
- - None
11
-
12
- ### Deprecated
13
-
14
- - None
15
-
16
- ### Added
17
-
18
- - None
19
-
20
- ### Fixed
21
-
22
- - [#889](https://github.com/airblade/paper_trail/pull/889) -
23
- Fix warning message in instances when a version can't be persisted due to validation errors.
24
- - [#868](https://github.com/airblade/paper_trail/pull/868)
25
- Fix usage of find_by_id when primary key is not id, affecting reifying certain records.
26
-
27
- ## 5.2.2 (2016-09-08)
28
-
29
- ### Breaking Changes
30
-
31
- - None
32
-
33
- ### Deprecated
34
-
35
- - [#863](https://github.com/airblade/paper_trail/pull/863) -
36
- PaperTrail.timestamp_field= deprecated without replacement.
37
- See [#861](https://github.com/airblade/paper_trail/pull/861) for discussion.
38
-
39
- ### Added
40
-
41
- - None
42
-
43
- ### Fixed
44
-
45
- - None
46
-
47
- ## 5.2.1 (2016-09-02)
48
-
49
- ### Breaking Changes
50
-
51
- - None
52
-
53
- ### Deprecated
54
-
55
- - None
56
-
57
- ### Added
58
-
59
- - None
60
-
61
- ### Fixed
62
-
63
- - [#857](https://github.com/airblade/paper_trail/pull/857) -
64
- Fix deserialization of enums written by PT 4.
65
- - [#798](https://github.com/airblade/paper_trail/issues/798) -
66
- Fix a rare bug with serialization of enums in rails 4.2 only when
67
- using `touch_with_version`.
68
-
69
- ## 5.2.0 (2016-06-27)
70
-
71
- ### Breaking Changes
72
-
73
- - None
74
-
75
- ### Deprecated
76
-
77
- - [#719](https://github.com/airblade/paper_trail/pull/719) -
78
- The majority of model methods. Use paper_trail.x instead of x. Why? Your
79
- models are a crowded namespace, and we want to get out of your way!
80
-
81
- ### Added
82
-
83
- - None
84
-
85
- ### Fixed
86
-
87
- - None
88
-
89
- ## 5.1.1 (2016-05-31)
90
-
91
- ### Breaking Changes
92
-
93
- - None
94
-
95
- ### Added
96
-
97
- - None
98
-
99
- ### Fixed
100
-
101
- - [#813](https://github.com/airblade/paper_trail/pull/813) -
102
- Warning for paper_trail_on_destroy(:after) for pre-releases of AR 5
103
- - [#651](https://github.com/airblade/paper_trail/issues/651) -
104
- Bug with installing PT on MySQL <= 5.6
105
-
106
- ## 5.1.0 (2016-05-20)
107
-
108
- ### Breaking Changes
109
-
110
- - None
111
-
112
- ### Added
113
-
114
- - [#809](https://github.com/airblade/paper_trail/pull/809) -
115
- Print warning if version cannot be saved.
116
-
117
- ### Fixed
118
-
119
- - [#812](https://github.com/airblade/paper_trail/pull/812) -
120
- Issue with saving HABTM associated objects using accepts_nested_attributes_for
121
- - [#811](https://github.com/airblade/paper_trail/pull/811) -
122
- Avoid unnecessary query in #record_destroy
123
- - Improvements to documentation
124
-
125
- ## 5.0.1 (2016-05-04)
126
-
127
- ### Breaking Changes
128
-
129
- - None
130
-
131
- ### Added
132
-
133
- - None
134
-
135
- ### Fixed
136
-
137
- - [#791](https://github.com/airblade/paper_trail/issues/791) -
138
- A rare issue in applications that override `warn`.
139
- - [#789](https://github.com/airblade/paper_trail/issues/789) -
140
- A potentially common issue, in applications with initializers that use
141
- versioned models.
142
-
143
- ## 5.0.0 (2016-05-02)
144
-
145
- ### Breaking Changes
146
-
147
- - [#758](https://github.com/airblade/paper_trail/pull/758) -
148
- `PaperTrail.config.track_associations` getter method removed,
149
- use `track_associations?` instead.
150
- - [#740](https://github.com/airblade/paper_trail/issues/740) -
151
- `PaperTrail.config.track_associations?` now defaults to false
152
- - [#723](https://github.com/airblade/paper_trail/pull/723) -
153
- `PaperTrail.enabled=` now affects all threads
154
- - [#556](https://github.com/airblade/paper_trail/pull/556) /
155
- [#301](https://github.com/airblade/paper_trail/issues/301) -
156
- If you are tracking who is responsible for changes with `whodunnit`, be aware
157
- that PaperTrail no longer adds the `set_paper_trail_whodunnit` before_action
158
- for you. Please add this before_action to your ApplicationController to
159
- continue recording whodunnit. See the readme for an example.
160
- - [#683](https://github.com/airblade/paper_trail/pull/683) /
161
- [#682](https://github.com/airblade/paper_trail/issues/682) -
162
- Destroy callback default changed to :before to accommodate ActiveRecord 5
163
- option `belongs_to_required_by_default` and new Rails 5 default.
164
-
165
- ### Added
166
-
167
- - [#771](https://github.com/airblade/paper_trail/pull/771) -
168
- Added support for has_and_belongs_to_many associations
169
- - [#741](https://github.com/airblade/paper_trail/issues/741) /
170
- [#681](https://github.com/airblade/paper_trail/pull/681)
171
- MySQL unicode support in migration generator
172
- - [#689](https://github.com/airblade/paper_trail/pull/689) -
173
- Rails 5 compatibility
174
- - Added a rails config option: `config.paper_trail.enabled`
175
- - [#503](https://github.com/airblade/paper_trail/pull/730) -
176
- Support for reifying belongs_to associations.
177
-
178
- ### Fixed
179
-
180
- - [#777](https://github.com/airblade/paper_trail/issues/777) -
181
- Support HMT associations with `:source` option.
182
- - [#738](https://github.com/airblade/paper_trail/issues/738) -
183
- Rare bug where a non-versioned STI parent caused `changeset` to
184
- return an empty hash.
185
- - [#731](https://github.com/airblade/paper_trail/pull/731) -
186
- Map enums to database values before storing in `object_changes` column.
187
- - [#715](https://github.com/airblade/paper_trail/issues/715) -
188
- Optimize post-rollback association reset.
189
- - [#701](https://github.com/airblade/paper_trail/pull/701) /
190
- [#699](https://github.com/airblade/paper_trail/issues/699) -
191
- Cleaning old versions explicitly preserves the most recent
192
- versions instead of relying on database result ordering.
193
- - [#635](https://github.com/airblade/paper_trail/issues/635) -
194
- A bug where it was not possible to disable PT when using a multi-threaded
195
- webserver.
196
- - [#584](https://github.com/airblade/paper_trail/issues/584) -
197
- Fixed deprecation warning for Active Record after_callback / after_commit
198
-
199
- ## 4.2.0 (2016-05-31)
200
-
201
- ### Breaking Changes
202
-
203
- - None
204
-
205
- ### Added
206
-
207
- - [#808](https://github.com/airblade/paper_trail/pull/808) -
208
- Warn when destroy callback is set to :after with ActiveRecord 5
209
- option `belongs_to_required_by_default` set to `true`.
210
-
211
- ### Fixed
212
-
213
- - None
214
-
215
- ## 4.1.0 (2016-01-30)
216
-
217
- ### Breaking Changes
218
-
219
- - None
220
-
221
- ### Added
222
-
223
- - A way to control the order of AR callbacks.
224
- [#614](https://github.com/airblade/paper_trail/pull/614)
225
- - Added `unversioned_attributes` option to `reify`.
226
- [#579](https://github.com/airblade/paper_trail/pull/579)
227
-
228
- ### Fixed
229
-
230
- - None
231
-
232
- ## 4.0.2 (2016-01-19)
233
-
234
- ### Breaking Changes
235
-
236
- - None
237
-
238
- ### Added
239
-
240
- - None
241
-
242
- ### Fixed
243
-
244
- - [#696](https://github.com/airblade/paper_trail/issues/696) /
245
- [#697](https://github.com/airblade/paper_trail/pull/697)
246
- Bind JSON query parameters in `where_object` and `where_object_changes`.
247
-
248
- ## 4.0.1 (2015-12-14)
249
-
250
- ### Breaking Changes
251
-
252
- - None
253
-
254
- ### Added
255
-
256
- - None
257
-
258
- ### Fixed
259
-
260
- - [#636](https://github.com/airblade/paper_trail/issues/636) -
261
- Should compile assets without a db connection
262
- - [#589](https://github.com/airblade/paper_trail/pull/589) /
263
- [#588](https://github.com/airblade/paper_trail/issues/588) -
264
- Fixes timestamp for "create" versions
265
-
266
- ## 4.0.0 (2015-07-30)
267
-
268
- This major release adds JSON column support in PostgreSQL, limited support for
269
- versioning associations, various new configuration options, and a year's worth
270
- of bug fixes. Thanks to everyone who helped test the two betas and two release
271
- candidates.
272
-
273
- ### Breaking Changes
274
-
275
- - Using a Rails initializer to reopen PaperTrail::Version or otherwise extend
276
- PaperTrail is no longer recommended. An alternative is described in the
277
- readme. See https://github.com/airblade/paper_trail/pull/557 and
278
- https://github.com/airblade/paper_trail/pull/492.
279
- - If you depend on the `RSpec` or `Cucumber` helpers, you must
280
- [require them in your test helper](https://github.com/airblade/paper_trail#testing).
281
- - [#566](https://github.com/airblade/paper_trail/pull/566) - Removed deprecated
282
- methods `paper_trail_on` and `paper_trail_off`. Use `paper_trail_on!` and
283
- `paper_trail_off!` instead.
284
- - [#458](https://github.com/airblade/paper_trail/pull/458) - Version metadata
285
- (the `:meta` option) from AR attributes for `create` events will now save the
286
- current value instead of `nil`.
287
- - [#391](https://github.com/airblade/paper_trail/issues/391) - `object_changes`
288
- value should dump to `YAML` as a normal `Hash` instead of an
289
- `ActiveSupport::HashWithIndifferentAccess`.
290
- - [#375](https://github.com/airblade/paper_trail/pull/375) /
291
- [#374](https://github.com/airblade/paper_trail/issues/374) /
292
- [#354](https://github.com/airblade/paper_trail/issues/354) /
293
- [#131](https://github.com/airblade/paper_trail/issues/131) -
294
- Versions are now saved with an `after_` callback, instead of a `before_`
295
- callback. This ensures that the timestamp field for a version matches the
296
- corresponding timestamp in the model.
297
- - `3da1f104` - `PaperTrail.config` and `PaperTrail.configure` are now
298
- identical: both return the `PaperTrail::Config` instance and also
299
- yield it if a block is provided.
300
-
301
- ### Added
302
-
303
- - [#525](https://github.com/airblade/paper_trail/issues/525) /
304
- [#512](https://github.com/airblade/paper_trail/pull/512) -
305
- Support for virtual accessors and redefined setter and getter methods.
306
- - [#518](https://github.com/airblade/paper_trail/pull/518) - Support for
307
- querying against PostgreSQL's
308
- [`JSON` and `JSONB` column types](http://www.postgresql.org/docs/9.4/static/datatype-json.html)
309
- via `PaperTrail::VersionConcern#where_object` and
310
- `PaperTrail::VersionConcern#where_object_changes`
311
- - [#507](https://github.com/airblade/paper_trail/pull/507) -
312
- New option: `:save_changes` controls whether or not to save changes to the
313
- `object_changes` column (if it exists).
314
- - [#500](https://github.com/airblade/paper_trail/pull/500) - Support for
315
- passing an empty array to the `on` option (`on: []`) to disable all
316
- automatic versioning.
317
- - [#494](https://github.com/airblade/paper_trail/issues/494) - The install
318
- generator will warn the user if the migration they are attempting to
319
- generate already exists.
320
- - [#484](https://github.com/airblade/paper_trail/pull/484) - Support for
321
- [PostgreSQL's `JSONB` Type](http://www.postgresql.org/docs/9.4/static/datatype-json.html)
322
- for storing `object` and `object_changes`.
323
- - [#439](https://github.com/airblade/paper_trail/pull/439) /
324
- [#12](https://github.com/airblade/paper_trail/issues/12) -
325
- Support for versioning associations (has many, has one, etc.) one level deep.
326
- - [#420](https://github.com/airblade/paper_trail/issues/420) - Add
327
- `VersionConcern#where_object_changes` instance method; acts as a helper for
328
- querying against the `object_changes` column in versions table.
329
- - [#416](https://github.com/airblade/paper_trail/issues/416) - Added a
330
- `config` option for enabling/disabling utilization of
331
- `serialized_attributes` for `ActiveRecord`, necessary because
332
- `serialized_attributes` has been deprecated in `ActiveRecord` version `4.2`
333
- and will be removed in version `5.0`
334
- - [#399](https://github.com/airblade/paper_trail/pull/399) - Add `:dup`
335
- argument for options hash to `reify` which forces a new model instance.
336
- - [#394](https://github.com/airblade/paper_trail/pull/394) - Add RSpec matcher
337
- `have_a_version_with` for easier testing.
338
- - [#347](https://github.com/airblade/paper_trail/pull/347) - Autoload
339
- `ActiveRecord` models in via a `Rails::Engine` when the gem is used with
340
- `Rails`.
341
-
342
- ### Fixed
343
-
344
- - [#563](https://github.com/airblade/paper_trail/pull/563) - Fixed a bug in
345
- `touch_with_version` so that it will still create a version even when the
346
- `on` option is, e.g. `[:create]`.
347
- - [#541](https://github.com/airblade/paper_trail/pull/541) -
348
- `PaperTrail.config.enabled` should be Thread Safe
349
- - [#451](https://github.com/airblade/paper_trail/issues/451) - Fix `reify`
350
- method in context of model where the base class has a default scope, and the
351
- live instance is not scoped within that default scope.
352
- - [#440](https://github.com/airblade/paper_trail/pull/440) - `versions`
353
- association should clear/reload after a transaction rollback.
354
- - [#438](https://github.com/airblade/paper_trail/issues/438) -
355
- `ModelKlass.paper_trail_enabled_for_model?` should return `false` if
356
- `has_paper_trail` has not been declared on the class.
357
- - [#404](https://github.com/airblade/paper_trail/issues/404) /
358
- [#428](https://github.com/airblade/paper_trail/issues/428) -
359
- `model_instance.dup` does not need to be invoked when examining what the
360
- instance looked like before changes were persisted, which avoids issues if a
361
- 3rd party has overriden the `dup` behavior. Also fixes errors occuring when
362
- a user attempts to update the inheritance column on an STI model instance in
363
- `ActiveRecord` 4.1.x
364
- - [#427](https://github.com/airblade/paper_trail/pull/427) - Fix `reify`
365
- method in context of model where a column has been removed.
366
- - [#414](https://github.com/airblade/paper_trail/issues/414) - Fix
367
- functionality `ignore` argument to `has_paper_trail` in `ActiveRecord` 4.
368
- - [#413](https://github.com/airblade/paper_trail/issues/413) - Utilize
369
- [RequestStore](https://github.com/steveklabnik/request_store) to ensure that
370
- the `PaperTrail.whodunnit` is set in a thread safe manner within Rails and
371
- Sinatra.
372
- - [#381](https://github.com/airblade/paper_trail/issues/381) - Fix `irb`
373
- warning: `can't alias context from irb_context`. `Rspec` and `Cucumber`
374
- helpers should not be loaded by default, regardless of whether those
375
- libraries are loaded.
376
- - [#248](https://github.com/airblade/paper_trail/issues/248) - In MySQL, to
377
- prevent truncation, generated migrations now use `longtext` instead of `text`.
378
- - Methods handling serialized attributes should fallback to the currently set
379
- Serializer instead of always falling back to `PaperTrail::Serializers::YAML`.
380
-
381
- ### Deprecated
382
-
383
- - [#479](https://github.com/airblade/paper_trail/issues/479) - Deprecated
384
- `originator` method, use `paper_trail_originator`.
385
-
386
- ## 3.0.9
387
-
388
- - [#479](https://github.com/airblade/paper_trail/issues/479) - Deprecated
389
- `originator` method in favor of `paper_trail_originator` Deprecation warning
390
- informs users that the `originator` of the methods will be removed in
391
- version `4.0`. (Backported from v4)
392
- - Updated deprecation warnings for `Model.paper_trail_on` and
393
- `Model.paper_trail_off` to have display correct version number the methods
394
- will be removed (`4.0`)
395
-
396
- ## 3.0.8
397
-
398
- - [#525](https://github.com/airblade/paper_trail/issues/525) / [#512](https://github.com/airblade/paper_trail/pull/512) -
399
- Support for virtual accessors and redefined setter and getter methods.
400
-
401
- ## 3.0.7
402
-
403
- - [#404](https://github.com/airblade/paper_trail/issues/404) / [#428](https://github.com/airblade/paper_trail/issues/428) -
404
- Fix errors occuring when a user attempts to update the inheritance column on an STI model instance in `ActiveRecord` 4.1.x
405
-
406
- ## 3.0.6
407
-
408
- - [#414](https://github.com/airblade/paper_trail/issues/414) - Backport fix for `ignore` argument to `has_paper_trail` in
409
- `ActiveRecord` 4.
410
-
411
- ## 3.0.5
412
-
413
- - [#401](https://github.com/airblade/paper_trail/issues/401) / [#406](https://github.com/airblade/paper_trail/issues/406) -
414
- `PaperTrail::Version` class is not loaded via a `Rails::Engine`, even when the gem is used within Rails. This feature has
415
- will be re-introduced in version `4.0`.
416
- - [#398](https://github.com/airblade/paper_trail/pull/398) - Only require the `RSpec` helper if `RSpec::Core` is required.
417
-
418
- ## 3.0.3
419
- *This version was yanked from RubyGems and has been replaced by version `3.0.5`, which is almost identical, but does not eager load
420
- in the `PaperTrail::Version` class through a `Rails::Engine` when the gem is used on Rails since it was causing issues for some users.*
421
-
422
- - [#386](https://github.com/airblade/paper_trail/issues/386) - Fix eager loading of `versions` association with custom class name
423
- in `ActiveRecord` 4.1.
424
- - [#384](https://github.com/airblade/paper_trail/issues/384) - Fix `VersionConcern#originator` instance method.
425
- - [#383](https://github.com/airblade/paper_trail/pull/383) - Make gem compatible with `ActiveRecord::Enum` (available in `ActiveRecord` 4.1+).
426
- - [#380](https://github.com/airblade/paper_trail/pull/380) / [#377](https://github.com/airblade/paper_trail/issues/377) -
427
- Add `VersionConcern#where_object` instance method; acts as a helper for querying against the `object` column in versions table.
428
- - [#373](https://github.com/airblade/paper_trail/pull/373) - Fix default sort order for the `versions` association in `ActiveRecord` 4.1.
429
- - [#372](https://github.com/airblade/paper_trail/pull/372) - Use [Arel](https://github.com/rails/arel) for SQL construction.
430
- - [#365](https://github.com/airblade/paper_trail/issues/365) - `VersionConcern#version_at` should return `nil` when receiving a timestamp
431
- that occured after the object was destroyed.
432
- - Expand `PaperTrail::VERSION` into a module, mimicking the form used by Rails to give it some additional modularity & versatility.
433
- - Fixed `VersionConcern#index` instance method so that it conforms to using the primary key for ordering when possible.
434
-
435
- ## 3.0.2
436
-
437
- - [#357](https://github.com/airblade/paper_trail/issues/357) - If a `Version` instance is reified and then persisted at that state,
438
- it's timestamp attributes for update should still get `touch`ed.
439
- - [#351](https://github.com/airblade/paper_trail/pull/351) / [#352](https://github.com/airblade/paper_trail/pull/352) -
440
- `PaperTrail::Rails::Controller` should hook into all controller types, and should not get loaded unless `ActionController` is.
441
- - [#346](https://github.com/airblade/paper_trail/pull/346) - `user_for_paper_trail` method should accommodate different types
442
- for return values from `current_user` method.
443
- - [#344](https://github.com/airblade/paper_trail/pull/344) - Gem is now tested against `MySQL` and `PostgreSQL` in addition to `SQLite`.
444
- - [#317](https://github.com/airblade/paper_trail/issues/317) / [#314](https://github.com/airblade/paper_trail/issues/314) -
445
- `versions` should default to ordering via the primary key if it is an integer to avoid timestamp comparison issues.
446
- - `PaperTrail::Cleaner.clean_versions!` should group versions by `PaperTrail.timestamp_field` when deciding which ones to
447
- keep / destroy, instead of always grouping by the `created_at` field.
448
- - If a `Version` instance is reified and then persisted at that state, it's source version
449
- (`model_instance#version_association_name`, usually `model_instance#version`) will get cleared since persisting it causes it to
450
- become the live instance.
451
- - If `destroy` actions are tracked for a versioned model, invoking `destroy` on the model will cause the corresponding version that
452
- gets generated to be assigned as the source version (`model_instance#version_association_name`, usually `model_instance#version`).
453
-
454
- ## 3.0.1
455
-
456
- - [#340](https://github.com/airblade/paper_trail/issues/340) - Prevent potential error encountered when using the `InstallGenerator`
457
- with Rails `4.1.0.rc1`.
458
- - [#334](https://github.com/airblade/paper_trail/pull/334) - Add small-scope `whodunnit` method to `PaperTrail::Model::InstanceMethods`.
459
- - [#329](https://github.com/airblade/paper_trail/issues/329) - Add `touch_with_version` method to `PaperTrail::Model::InstanceMethods`,
460
- to allow for generating a version while `touch`ing a model.
461
- - [#328](https://github.com/airblade/paper_trail/pull/328) / [#326](https://github.com/airblade/paper_trail/issues/326) /
462
- [#307](https://github.com/airblade/paper_trail/issues/307) - `Model.paper_trail_enabled_for_model?` and
463
- `model_instance.without_versioning` is now thread-safe.
464
- - [#316](https://github.com/airblade/paper_trail/issues/316) - `user_for_paper_trail` should default to `current_user.try(:id)`
465
- instead of `current_user` (if `current_user` is defined).
466
- - [#313](https://github.com/airblade/paper_trail/pull/313) - Make the `Rails::Controller` helper compatible with
467
- `ActionController::API` for compatibility with the [`rails-api`](https://github.com/rails-api/rails-api) gem.
468
- - [#312](https://github.com/airblade/paper_trail/issues/312) - Fix RSpec `with_versioning` class level helper method.
469
- - `model_instance.without_versioning` now yields the `model_instance`, enabling syntax like this:
470
- `model_instance.without_versioning { |obj| obj.update_attributes(:name => 'value') }`.
471
- - Deprecated `Model.paper_trail_on` and `Model.paper_trail_off` in favor of bang versions of the methods.
472
- Deprecation warning informs users that the non-bang versions of the methods will be removed in version `4.0`
473
-
474
- ## 3.0.0
475
-
476
- - [#305](https://github.com/airblade/paper_trail/pull/305) - `PaperTrail::VERSION` should be loaded at runtime.
477
- - [#295](https://github.com/airblade/paper_trail/issues/295) - Explicitly specify table name for version class when
478
- querying attributes. Prevents `AmbiguousColumn` errors on certain `JOIN` statements.
479
- - [#289](https://github.com/airblade/paper_trail/pull/289) - Use `ActiveSupport::Concern` for implementation of base functionality on
480
- `PaperTrail::Version` class. Increases flexibility and makes it easier to use custom version classes with multiple `ActiveRecord` connections.
481
- - [#288](https://github.com/airblade/paper_trail/issues/288) - Change all scope declarations to class methods on the `PaperTrail::Version`
482
- class. Fixes usability when `PaperTrail::Version.abstract_class? == true`.
483
- - [#287](https://github.com/airblade/paper_trail/issues/287) - Support for
484
- [PostgreSQL's JSON Type](http://www.postgresql.org/docs/9.2/static/datatype-json.html) for storing `object` and `object_changes`.
485
- - [#281](https://github.com/airblade/paper_trail/issues/281) - `Rails::Controller` helper will return `false` for the
486
- `paper_trail_enabled_for_controller` method if `PaperTrail.enabled? == false`.
487
- - [#280](https://github.com/airblade/paper_trail/pull/280) - Don't track virtual timestamp attributes.
488
- - [#278](https://github.com/airblade/paper_trail/issues/278) / [#272](https://github.com/airblade/paper_trail/issues/272) -
489
- Make RSpec and Cucumber helpers usable with [Spork](https://github.com/sporkrb/spork) and [Zeus](https://github.com/burke/zeus).
490
- - [#273](https://github.com/airblade/paper_trail/pull/273) - Make the `only` and `ignore` options accept `Hash` arguments;
491
- allows for conditional tracking.
492
- - [#264](https://github.com/airblade/paper_trail/pull/264) - Allow unwrapped symbol to be passed in to the `on` option.
493
- - [#224](https://github.com/airblade/paper_trail/issues/224)/[#236](https://github.com/airblade/paper_trail/pull/236) -
494
- Fixed compatibility with [ActsAsTaggableOn](https://github.com/mbleigh/acts-as-taggable-on).
495
- - [#235](https://github.com/airblade/paper_trail/pull/235) - Dropped unnecessary secondary sort on `versions` association.
496
- - [#216](https://github.com/airblade/paper_trail/pull/216) - Added helper & extension for [RSpec](https://github.com/rspec/rspec),
497
- and helper for [Cucumber](http://cukes.info).
498
- - [#212](https://github.com/airblade/paper_trail/pull/212) - Added `PaperTrail::Cleaner` module, useful for discarding draft versions.
499
- - [#207](https://github.com/airblade/paper_trail/issues/207) - Versions for `'create'` events are now created with `create!` instead of
500
- `create` so that an exception gets raised if it is appropriate to do so.
501
- - [#199](https://github.com/airblade/paper_trail/pull/199) - Rails 4 compatibility.
502
- - [#165](https://github.com/airblade/paper_trail/pull/165) - Namespaced the `Version` class under the `PaperTrail` module.
503
- - [#119](https://github.com/airblade/paper_trail/issues/119) - Support for [Sinatra](http://www.sinatrarb.com/); decoupled gem from `Rails`.
504
- - Renamed the default serializers from `PaperTrail::Serializers::Yaml` and `PaperTrail::Serializers::Json` to the capitalized forms,
505
- `PaperTrail::Serializers::YAML` and `PaperTrail::Serializers::JSON`.
506
- - Removed deprecated `set_whodunnit` method from Rails Controller scope.
507
-
508
- ## 2.7.2
509
-
510
- - [#228](https://github.com/airblade/paper_trail/issues/228) - Refactored default `user_for_paper_trail` method implementation
511
- so that `current_user` only gets invoked if it is defined.
512
- - [#219](https://github.com/airblade/paper_trail/pull/219) - Fixed issue where attributes stored with `nil` value might not get
513
- reified properly depending on the way the serializer worked.
514
- - [#213](https://github.com/airblade/paper_trail/issues/213) - Added a `version_limit` option to the `PaperTrail::Config` options
515
- that can be used to restrict the number of versions PaperTrail will store per object instance.
516
- - [#187](https://github.com/airblade/paper_trail/pull/187) - Confirmed JRuby support.
517
- - [#174](https://github.com/airblade/paper_trail/pull/174) - The `event` field on the versions table can now be customized.
518
-
519
- ## 2.7.1
520
-
521
- - [#206](https://github.com/airblade/paper_trail/issues/206) - Fixed Ruby 1.8.7 compatibility for tracking `object_changes`.
522
- - [#200](https://github.com/airblade/paper_trail/issues/200) - Fixed `next_version` method so that it returns the live model
523
- when called on latest reified version of a model prior to the live model.
524
- - [#197](https://github.com/airblade/paper_trail/issues/197) - PaperTrail now falls back on using YAML for serialization of
525
- serialized model attributes for storage in the `object` and `object_changes` columns in the `Version` table. This fixes
526
- compatibility for `Rails 3.0.x` for projects that employ the `serialize` declaration on a model.
527
- - [#194](https://github.com/airblade/paper_trail/issues/194) - A JSON serializer is now included in the gem.
528
- - [#192](https://github.com/airblade/paper_trail/pull/192) - `object_changes` should store serialized representation of serialized
529
- attributes for `create` actions (in addition to `update` actions, which had already been patched by
530
- [#180](https://github.com/airblade/paper_trail/pull/180)).
531
- - [#190](https://github.com/airblade/paper_trail/pull/190) - Fixed compatibility with
532
- [SerializedAttributes](https://github.com/technoweenie/serialized_attributes) gem.
533
- - [#189](https://github.com/airblade/paper_trail/pull/189) - Provided support for a `configure` block initializer.
534
- - Added `setter` method for the `serializer` config option.
535
-
536
- ## 2.7.0
537
-
538
- - [#183](https://github.com/airblade/paper_trail/pull/183) - Fully qualify the `Version` class to help prevent
539
- namespace resolution errors within other gems / plugins.
540
- - [#180](https://github.com/airblade/paper_trail/pull/180) - Store serialized representation of serialized attributes
541
- on the `object` and `object_changes` columns in the `Version` table.
542
- - [#164](https://github.com/airblade/paper_trail/pull/164) - Allow usage of custom serializer for storage of object attributes.
543
-
544
- ## 2.6.4
545
-
546
- - [#181](https://github.com/airblade/paper_trail/issues/181)/[#182](https://github.com/airblade/paper_trail/pull/182) -
547
- Controller metadata methods should only be evaluated when `paper_trail_enabled_for_controller == true`.
548
- - [#177](https://github.com/airblade/paper_trail/issues/177)/[#178](https://github.com/airblade/paper_trail/pull/178) -
549
- Factored out `version_key` into it's own method to prevent `ConnectionNotEstablished` error from getting thrown in
550
- instances where `has_paper_trail` is declared on class prior to ActiveRecord establishing a connection.
551
- - [#176](https://github.com/airblade/paper_trail/pull/176) - Force metadata calls for attributes to use current value
552
- if attribute value is changing.
553
- - [#173](https://github.com/airblade/paper_trail/pull/173) - Update link to [diff-lcs](https://github.com/halostatue/diff-lcs).
554
- - [#172](https://github.com/airblade/paper_trail/pull/172) - Save `object_changes` on creation.
555
- - [#168](https://github.com/airblade/paper_trail/pull/168) - Respect conditional `:if` or `:unless` arguments to the
556
- `has_paper_trail` method for `destroy` events.
557
- - [#167](https://github.com/airblade/paper_trail/pull/167) - Fix `originator` method so that it works with subclasses and STI.
558
- - [#160](https://github.com/airblade/paper_trail/pull/160) - Fixed failing tests and resolved out of date dependency issues.
559
- - [#157](https://github.com/airblade/paper_trail/pull/157) - Refactored `class_attribute` names on the `ClassMethods` module
560
- for names that are not obviously pertaining to PaperTrail to prevent method name collision.