-
Notifications
You must be signed in to change notification settings - Fork 909
#1459 - create paper_trail.rb initializer that disables versioning on touch events by default. #1520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ngobin
wants to merge
4
commits into
paper-trail-gem:master
Choose a base branch
from
ngobin:add-initializer-to-generator
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+58
−1
Open
#1459 - create paper_trail.rb initializer that disables versioning on touch events by default. #1520
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
079f893
#1459 - create paper_trail.rb initializer that disables versioning on…
ngobin 01f5416
Update rails_8.0.gemfile
ngobin a581531
keep touch events in initializer for consistent default behaviour as …
ngobin 0b390c0
Merge branch 'master' into add-initializer-to-generator
ngobin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
lib/generators/paper_trail/install/templates/paper_trail.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # This file is automatically generated by `rails generate paper_trail:install` | ||
| # and goes in `YourApp/config/initializers/`. | ||
| # Each model can override most of these global settings on a per-model basis. | ||
|
|
||
| ## Enable/disable PaperTrail globally | ||
| PaperTrail.config.enabled = true | ||
|
|
||
| ## Track versions on create, update, & destroy, but not touch events to reduce version table size. | ||
| ## Add `touch` below to track touch events, or comment out (default behaviour tracks all events). | ||
| PaperTrail.config.has_paper_trail_defaults = { | ||
| on: %i[create update destroy] | ||
| } | ||
|
|
||
| ## Limit the number of versions saved per record. | ||
| ## The version limit does not apply to `create` events | ||
| ## Default is nil (no limit) | ||
| # PaperTrail.config.version_limit = 3 | ||
|
|
||
| ## Define error handling behaviour. | ||
| ## options: | ||
| ### :legacy # Raise on create, log on update/delete (Default) | ||
| ### :log # only log the error | ||
| ### :exception # raise exception | ||
| ### :silent # do nothing | ||
| # PaperTrail.config.version_error_behavior = :legacy | ||
|
|
||
| ## See the readme for other important configuration steps such as setting whodunnit, | ||
| ## and enabling/disabling paper_trail in tests. | ||
| ## https://github.com/paper-trail-gem/paper_trail#readme | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like the generation of this file but i don't think the config generated here should differ from the existing defaults. i realize this goes against part of the intent of your pr but it results in an implicit change to the defaults for anyone starting from scratch which feels inconsistent to me.