Skip to content

Commit

Permalink
Merge tag 'v10.0.0' into test-rails5-ruby24
Browse files Browse the repository at this point in the history
v10.0.0

* tag 'v10.0.0': (40 commits)
  Release 10.0.0
  Testing the :skip option
  allow `object_changes_adapter` to use the default behavior
  Lint: Improve Metrics/AbcSize from 22 to 21
  Docs: which class attributes are public/private
  Docs: installation
  Docs: Update changelog and readme re: paper-trail-gem#1143
  Generator to update historic item_subtype entries (paper-trail-gem#1144)
  Testing joins, as recommended by Sean
  Add optional column: item_subtype
  Revert paper-trail-gem#1108 (lorint's STI fix)
  Lint: RSpec/EmptyLineAfterExampleGroup
  Update development dependencies
  Lint: RSpec/InstanceVariable in model_spec, ctn'd
  Code style re: errors
  Docs: Fix link to bug report
  Add association tracking removal exception
  Readme fix: caller.find {} rather than caller.first {}
  Do not require PT-AT
  Docs: Organizing the changelog for 10.0.0
  ...
  • Loading branch information
hosamaly committed Feb 21, 2021
2 parents e01ca4e + fbedbd8 commit 1a3b18a
Show file tree
Hide file tree
Showing 76 changed files with 1,884 additions and 1,227 deletions.
38 changes: 25 additions & 13 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,36 @@

Thanks for your interest in PaperTrail!

Ask usage questions on Stack Overflow:
https://stackoverflow.com/tags/paper-trail-gem
## Reporting Security Vulnerabilities

Please email jared@jaredbeck.com and batkinz@gmail.com. Do not mention the
vulnerability publicly until there's a fix.

We will respond as soon as we can. Thank you for responsibly disclosing
security vulnerabilities.

**Please do not use github issues to ask usage questions.**
## Usage Questions

On github, we appreciate bug reports, feature suggestions, and pull requests.
Due to limited volunteers, we cannot answer *usage* questions. Please ask such
questions on [StackOverflow](https://stackoverflow.com/tags/paper-trail-gem).

## Reporting Bugs

Please use our [bug report template][1].
You want to fix a bug, but need some help.

## Reporting Security Vulnerabilities
> You are required to provide a script that reproduces the bug, using our
> template. You are required to fix the bug. We're here to help, but no one else
> will fix it for you. If you don't fix the bug in a reasonable amount of time,
> your issue will be closed.
> - From our [issue template][1].
Please email jared@jaredbeck.com, batkinz@gmail.com
Due to limited volunteers, we cannot fix everyone's bugs for them. We're happy
to help, but we can only accept issues from people committed to working on their
own problems.

We will respond as soon as we can. Thank you for responsibly disclosing
security vulnerabilities.
Different people use different parts of PaperTrail. You may have found a bug,
but you might also be the only person affected by that bug. Don't hesitate to
ask for whatever help you need, but it's your job to fix it.

## Development

Expand Down Expand Up @@ -61,9 +74,8 @@ DB=postgres bundle exec appraisal ar-5.2 rake
## Adding new schema

Edit `spec/dummy_app/db/migrate/20110208155312_set_up_test_tables.rb`. Migration
will be performed by `spec_helper.rb`, so you can just run rake as shown above.
Also, `spec/dummy_app/db/schema.rb` is deliberately `.gitignore`d, we don't use
it.
will be performed by `rake`, so you can just run it as shown above. Also,
`spec/dummy_app/db/schema.rb` is deliberately `.gitignore`d, we don't use it.

## Documentation

Expand Down Expand Up @@ -91,4 +103,4 @@ markdown-toc -i --maxdepth 3 --bullets='-' README.md
1. git tag -a -m "v5.0.0" "v5.0.0" # or whatever number
1. git push --tags origin

[1]: /~https://github.com/paper-trail-gem/paper_trail/blob/master/doc/bug_report_template.rb
[1]: /~https://github.com/paper-trail-gem/paper_trail/blob/master/.github/ISSUE_TEMPLATE/bug_report.md
20 changes: 11 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
name: Bug Report
name: I want to fix a bug, but need some help
about: >
You will be asked to provide a script that reproduces the bug, based on our
template.
You must provide a script that reproduces the bug, using our template. We'll
help, but you must fix the bug, in a reasonable amount of time, or your issue
will be closed. See CONTRIBUTING.md
---

Expand All @@ -14,17 +15,18 @@ Bug reports must use the following template:
```ruby
# frozen_string_literal: true

# Use this template to report PaperTrail bugs.
# Please include only the minimum code necessary to reproduce your issue.
require "bundler/inline"

# STEP ONE: What versions are you using?
gemfile(true) do
ruby "2.4.2"
ruby "2.5.1"
source "https://rubygems.org"
gem "activerecord", "5.1.4"
gem "minitest", "5.10.3"
gem "paper_trail", "9.1.0", require: false
gem "sqlite3"
gem "activerecord", "5.2.0"
gem "minitest", "5.11.3"
gem "paper_trail", "9.2.0", require: false
gem "sqlite3", "1.3.13"
end

require "active_record"
Expand Down Expand Up @@ -60,7 +62,7 @@ class User < ActiveRecord::Base
has_paper_trail
end

# STEP FIVE: Write a test that demonstrates your issue by failing.
# STEP FIVE: Please write a test that demonstrates your issue.
class BugTest < ActiveSupport::TestCase
def test_1
assert_difference(-> { PaperTrail::Version.count }, +1) {
Expand Down
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_suggestion.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
name: Feature Suggestion
about: Suggest something that you would like to build
about: >
Suggest something that you would like to build. We'll help, but you must build
it yourself, in a reasonable amount of time, or your issue will be closed. See
CONTRIBUTING.md
---

Expand Down
16 changes: 10 additions & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ Naming/PredicateName:
Naming/UncommunicativeMethodParamName:
Enabled: false

# This cop does not seem to work in rubocop-rspec 1.28.0
RSpec/DescribeClass:
Enabled: false

# Yes, ideally examples would be short. Is it possible to pick a limit and say,
# "no example will ever be longer than this"? Hard to say. Sometimes they're
# quite long.
RSpec/ExampleLength:
Enabled: false

RSpec/FilePath:
Exclude:
- spec/paper_trail/association_reify_error_behaviour/error.rb
Expand All @@ -108,12 +118,6 @@ RSpec/FilePath:
RSpec/MultipleExpectations:
Enabled: false

# Yes, ideally examples would be short. Is it possible to pick a limit and say,
# "no example will ever be longer than this"? Hard to say. Sometimes they're
# quite long.
RSpec/ExampleLength:
Enabled: false

# Please use semantic style, e.g. `do` when there's a side-effect, else `{}`.
# The semantic style is too nuanced to lint, so the cop is disabled.
Style/BlockDelimiters:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require: rubocop-rspec
# one by one as the offenses are removed from the code base.

Metrics/AbcSize:
Max: 22 # Goal: 15
Max: 21 # Goal: 15

Metrics/CyclomaticComplexity:
Max: 8 # Goal: 6
Expand Down
21 changes: 10 additions & 11 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,21 @@
appraise "ar-4.2" do
gem "activerecord", "~> 4.2.10"
gem "database_cleaner", "~> 1.6"

# not compatible with mysql2 0.5
# /~https://github.com/brianmario/mysql2/issues/950#issuecomment-376259151
gem "mysql2", "~> 0.4.10"

# not compatible with pg 1.0.0
gem "pg", "~> 0.21.0"
end

appraise "ar-5.1" do
gem "activerecord", "~> 5.1.5"
gem "rails-controller-testing"
gem "rails-controller-testing", "~> 1.0.2"
end

appraise "ar-5.2" do
gem "activerecord", "~> 5.2.0.rc2"
gem "rails-controller-testing"

# bundler does not handle rc versions well
# /~https://github.com/paper-trail-gem/paper_trail/pull/1067
# so we specify activesupport, actionpack, and railties, which we
# would not normally do, as you can see with other rails versions above.
gem "activesupport", "~> 5.2.0.rc2"
gem "actionpack", "~> 5.2.0.rc2"
gem "railties", "~> 5.2.0.rc2"
gem "activerecord", "~> 5.2.1"
gem "rails-controller-testing", "~> 1.0.2"
end
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,57 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).

- None

## 10.0.0 (2018-09-01)

PT 10 tackles some tough issues that required breaking changes. We fixed a
rare issue with STI, and saved major disk space in databases with tens
of millions of version records. Special thanks to @lorint and @seanlinsley,
respectively.

### Breaking changes affecting most people

- [#1132](/~https://github.com/paper-trail-gem/paper_trail/pull/1132) - Removed a
dozen methods deprecated in PT 9. Make sure you've addressed all deprecation
warnings before upgrading.

### Breaking changes affecting fewer people

- [db9c392d](/~https://github.com/paper-trail-gem/paper_trail/commit/db9c392d) -
`paper_trail-association_tracking` is no longer a runtime dependency. If you
use it (`track_associations = true`) you must now add it to your own `Gemfile`.
See also [PT-AT #7](/~https://github.com/westonganger/paper_trail-association_tracking/issues/7)
- [#1130](/~https://github.com/paper-trail-gem/paper_trail/pull/1130) -
Removed `save_changes`. For those wanting to save space, it's more effective
to drop the `object` column. If you need ultimate control over the
`object_changes` column, you can write your own `object_changes_adapter`.

### Breaking changes most people won't care about

- [#1121](/~https://github.com/paper-trail-gem/paper_trail/issues/1121) -
`touch` now always inserts `null` in `object_changes`.
- [#1123](/~https://github.com/paper-trail-gem/paper_trail/pull/1123) -
`object_changes` is now populated on destroy in order to make
`where_object_changes` usable when you've dropped the `object` column.
Sean is working on an optional backport migration and will post about it in
[#1099](/~https://github.com/paper-trail-gem/paper_trail/issues/1099) when
he's done.

### Added

- [#1099](/~https://github.com/paper-trail-gem/paper_trail/issues/1099) -
Ability to save ~50% storage space by making the `object` column optional.
Note that this disables `reify` and `where_object`.

### Fixed

- [#594](/~https://github.com/paper-trail-gem/paper_trail/issues/594) -
A rare issue with reification of STI subclasses, affecting only PT-AT users
who have a model with mutliple associations, whose foreign keys are named the
same, and whose foreign models are STI with the same parent class. This fix
requires a schema change. See [docs section 4.b.1 The optional `item_subtype`
column](/~https://github.com/paper-trail-gem/paper_trail#4b-associations) for
instructions.

## 9.2.0 (2018-06-09)

### Breaking Changes
Expand Down
Loading

0 comments on commit 1a3b18a

Please sign in to comment.