forked from paper-trail-gem/paper_trail
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
Enable version associations through config property #2
Closed
Conversation
This file contains 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
Default order by timestamp to ensure early versions are cleaned
[Fixes #694] [ci skip]
Looks like the heading changed at some point, not allowing one to easily click down to that section
Fix link to Custom Serializer section
Remove duplicate link to RailsCast
Pass ar5 tests
When running rspec from rake, hide the list of specs. (bit.ly/1nVq3Jn)
Hide list of specs
add documentation for paper_trail-globalid extentsion
The joy of linting
Note that the `private` access modifier has been removed. Actually fixing said modifier would be a breaking change.
[ci skip]
Log errors when versions can't be created
[ci skip]
It already was organized *in memory* but now it's organized in files. Also, there are six fewer methods being mixed into the model class (they became ObjectAttribute and ObjectChangesAttribute). I like how the legacy (rails < 4.2) support is now all in one file, so it'll be really easy to drop when the time comes. Finally, a minor thing, I renamed CastedAttributeSerializer to CastAttributeSerializer, because I don't think "casted" is the correct conjugation.
Break AttributesSerialization into small modules
When updating 2 models with a HABTM association, and using accepts_nested_attributes_for, the association was using the version ID instead of the transaction ID to reference the change. This was braking the association logic and preventing proper reification.
Fix MySQL 5.6 bug re: item_type length
* Accept either a String or a Symbol * Correctly warn on beta versions of ActiveRecord 5
…arning Fix deprecation warning for paper_trail_on_destroy(:after)
[ci skip]
[ci skip]
Problem ------- `has_paper_trail` adds too many methods to the ActiveRecord model. > If I'm counting correctly, installing the paper_trail gem adds 36 instance > methods and 10 class methods to all of your active record models. Of those > 46, 13 have a prefix, either "pt_" or "paper_trail_". I don't know what the > best way to deal with this is. Ideally, we'd add far fewer methods to > people's models. If we were able to add fewer methods to models, then I > wouldn't mind prefixing all of them. > #703 Solution -------- Add only two methods to the AR model. 1. An instance method `#paper_trail` 2. A class method `.paper_trail` The instance method would return a `RecordTrail` and the class method would return a `ClassTrail`. Those names are totally up for debate. Advantages ---------- - Plain ruby, easy to understand - Adding new methods to e.g. the `RecordTrail` does not add any methods to the AR model. - Methods privacy is more strongly enforced. - Enables isolated testing of e.g. `RecordTrail`; it can be constructed with a mock AR instance. Disadvantages ------------- - Two new classes, though they are simple.
…ontroller Adding guard clause to prevent calling user_for_paper_trail
…_warning Add filename to whodunnit warning
An idea to combat model pollution
People still don't realize that the master readme documents unreleased features. e.g. #829 [ci skip]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Apologies for developed-on-github pullrequest. Currently on vacation with poor internet.