Skip to content

Commit

Permalink
small documentation edits
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Mar 14, 2017
1 parent 00eae33 commit 22d283b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ YES! Make sure you do the steps above.
| inserted_at | Date | inserted_at timestamp | Ecto generates |

### Version origin references:
PaperTrail records have a string field called ``origin```. ```PaperTrail.insert/1```, ```PaperTrail.update/1```, ```PaperTrail.delete/1``` functions accept a second argument to describe the origin of this version. Example:
PaperTrail records have a string field called ```origin```. ```PaperTrail.insert/1```, ```PaperTrail.update/1```, ```PaperTrail.delete/1``` functions accept a second argument to describe the origin of this version:
```elixir
PaperTrail.update(changeset, origin: "migration")
# or:
Expand All @@ -156,7 +156,7 @@ PaperTrail.delete(changeset, origin: "worker:delete_inactive_users")
```

### Originator relationships
You can specify setter/originator relationship to paper_trail versions with ```originator_id``` assignment during PaperTrail operations. This feature is only possible by specifying `:originator` keyword list for your application configuration:
You can specify setter/originator relationship to paper_trail versions with ```originator_id``` assignment. This feature is only possible by specifying `:originator` keyword list for your application configuration:

```elixir
# in your config/config.exs
Expand Down Expand Up @@ -194,7 +194,7 @@ defmodule Repo.Migrations.AddVersions do
add :name, :string, null: false
add :founded_in, :string

# null constraint is optional to make model insertion impossible without a version:
# null constraints are highly suggested:
add :first_version_id, references(:versions), null: false
add :current_version_id, references(:versions), null: false

Expand Down

0 comments on commit 22d283b

Please sign in to comment.