Skip to content

Commit

Permalink
Fix CI badge
Browse files Browse the repository at this point in the history
  • Loading branch information
westonganger committed Nov 1, 2023
1 parent c8e8b2c commit 6c1df7d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# PaperTrail-AssociationTracking

<a href="https://badge.fury.io/rb/paper_trail-association_tracking" target="_blank"><img height="21" style='border:0px;height:21px;' border='0' src="https://badge.fury.io/rb/paper_trail-association_tracking.svg" alt="Gem Version"></a>
<a href='https://github.com/westonganger/paper_trail-association_tracking/actions' target='_blank'><img src="https://github.com/westonganger/paper_trail-association_tracking/workflows/Tests/badge.svg" style="max-width:100%;" height='21' style='border:0px;height:21px;' border='0' alt="CI Status"></a>
<a href='https://github.com/westonganger/paper_trail-association_tracking/actions' target='_blank'><img src="https://github.com/westonganger/paper_trail-association_tracking/actions/workflows/test.yml/badge.svg?branch=master" style="max-width:100%;" height='21' style='border:0px;height:21px;' border='0' alt="CI Status"></a>
<a href='https://rubygems.org/gems/paper_trail-association_tracking' target='_blank'><img height='21' style='border:0px;height:21px;' src='https://img.shields.io/gem/dt/paper_trail-association_tracking?color=brightgreen&label=Rubygems%20Downloads' border='0' alt='RubyGems Downloads' /></a>

Plugin for the [PaperTrail](https://github.com/paper-trail-gem/paper_trail.git) gem to track and reify associations. This gem was extracted from PaperTrail for v9.2.0 to simplify things in PaperTrail and association tracking separately.
Plugin for the [PaperTrail](https://github.com/paper-trail-gem/paper_trail.git) gem to track and reify associations. This gem was extracted from PaperTrail for v9.2.0 to simplify things in PaperTrail and association tracking separately.

**PR's will happily be accepted**

PaperTrail-AssociationTracking can restore three types of associations: Has-One, Has-Many, and Has-Many-Through.
PaperTrail-AssociationTracking can restore three types of associations: Has-One, Has-Many, and Has-Many-Through.

It will store in the `version_associations` table additional information to correlate versions of the association and versions of the model when the associated record is changed. When reifying the model, it will utilize this table, together with the `transaction_id` to find the correct version of the association and reify it. The `transaction_id` is a unique id for version records created in the same transaction. It is used to associate the version of the model and the version of the association that are created in the same transaction.

Expand Down Expand Up @@ -67,7 +67,7 @@ product = Product.first.versions.last.reify(has_many: true, has_one: true, belon
product.save! ### now this will also save all reified photos
```

If you do not set `autosave: true` true on the association then you will have to save/delete them manually.
If you do not set `autosave: true` true on the association then you will have to save/delete them manually.

For example:

Expand Down Expand Up @@ -143,14 +143,14 @@ t.location.latitude # 12.345, instead of 54.321
has_many :books, through: :authorships
has_paper_trail
end

### Each of the following will store authorship versions:
@book.authors << @john
@book.authors.create(name: 'Jack')
@book.authorships.last.destroy
@book.authorships.clear
@book.author_ids = [@john.id, @joe.id]

### But none of these will:
@book.authors.delete @john
@book.author_ids = []
Expand Down

0 comments on commit 6c1df7d

Please sign in to comment.