Skip to content

Commit

Permalink
0.6.3 release and README credits.
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Mar 15, 2017
1 parent d170675 commit fba3c64
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 32 deletions.
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ PaperTrail is assailed with hundreds of test assertions for each release. Data i
# updated_at: #Ecto.DateTime<2016-09-15 21:42:38>},
# item_id: 1, item_type: "Post", originator_id: nil, originator: nil, meta: nil}}}

# => on error(it matches Repo.insert\2):
# => on error(it matches Repo.insert/2):
# {:error, Ecto.Changeset<action: :insert,
# changes: %{title: "Word on the street is Elixir got its own database versioning library", content: "You should try it now!"},
# errors: [content: {"is too short", []}], data: #Post<>,
Expand All @@ -53,7 +53,7 @@ PaperTrail is assailed with hundreds of test assertions for each release. Data i
# item_id: 1, item_type: "Post", originator_id: nil, originator: nil
# meta: nil}}}

# => on error(it matches Repo.update\2):
# => on error(it matches Repo.update/2):
# {:error, Ecto.Changeset<action: :update,
# changes: %{title: "Elixir matures fast", content: "Future is already here, you deserve to be awesome!"},
# errors: [title: {"is too short", []}], data: #Post<>,
Expand Down Expand Up @@ -116,7 +116,7 @@ The library source code is minimal and well tested. It is suggested to read the

3. install and compile your dependency:

```mix deps.compile```
```mix deps.get && mix deps.compile```

4. run this command to generate the migration:

Expand All @@ -142,7 +142,7 @@ YES! Make sure you do the steps above.
| item_changes | Map | all the changes in this version as a map | Library generates |
| originator_id | Integer | foreign key reference to the creator/owner of this change | Optionally set |
| origin | String | short reference to origin(eg. worker:activity-checker, migration, admin:33) | Optionally set |
| meta | Map | any extra optional meta information about the version(eg. %{slug: "ausername"}) | Optionally set |
| meta | Map | any extra optional meta information about the version(eg. %{slug: "ausername", important: true}) | Optionally set |
| inserted_at | Date | inserted_at timestamp | Ecto generates |

### Version origin references:
Expand All @@ -153,6 +153,10 @@ PaperTrail.update(changeset, origin: "migration")
PaperTrail.update(changeset, origin: "user:1234")
# or:
PaperTrail.delete(changeset, origin: "worker:delete_inactive_users")
# or:
PaperTrail.insert(new_user_changeset, origin: "password_registration")
# or:
PaperTrail.insert(new_user_changeset, origin: "facebook_registration")
```

### Originator relationships
Expand Down Expand Up @@ -259,7 +263,7 @@ edited_company = Company.changeset(company, %{name: "Acme Inc."}) |> PaperTrail.
Additionally, you can put a null constraint on ```origin``` column, you should always put an ```origin``` reference to describe who makes the change. This is important for big applications because a model can change from many sources.

### Storing version meta data
You might want to add some meta data that doesn't belong to ``originator_id`` and ``origin`` fields. Such data could be stored in one object named ```meta``` in paper_trail versions. Meta field could be passed as the second optional parameter to PaperTrail.insert\\2, PaperTrail.update\\2, PaperTrail.delete\\2 functions:
You might want to add some meta data that doesn't belong to ``originator_id`` and ``origin`` fields. Such data could be stored in one object named ```meta``` in paper_trail versions. Meta field could be passed as the second optional parameter to PaperTrail.insert/2, PaperTrail.update/2, PaperTrail.delete/2 functions:

```elixir
company = Company.changeset(%Company{}, %{name: "Acme Inc."})
Expand All @@ -278,5 +282,15 @@ deleted_company = Company.changeset(edited_company, %{})
- don't delete your paper_trail versions, instead you can merge them
- If you have a question or a problem, do not hesitate to create an issue or submit a pull request

## TODO:
** remove wrong Elixir compiler errors
# Credits
Many thanks to:

[Jose Pablo Castro](https://github.com/josepablocastro) - Built the repo configuration for paper_trail
[Alex Antonov](https://github.com/asiniy) - Original inventor of the originator feature
[Josh Taylor](https://github.com/joshuataylor) - Maintenance and new feature suggestions
[Mitchell Henke](https://github.com/mitchellhenke) - Fixed weird elixir compiler warnings
[Izel Nakri](https://github.com/izelnakri) - The Originator of this library. See what I did there ;)

Additional thanks to:
[Ruby paper_trail gem](https://github.com/airblade/paper_trail) - Initial inspiration of this project.
[Ecto](https://github.com/elixir-ecto/ecto) - For the great API.
4 changes: 2 additions & 2 deletions doc/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.14.5">
<title>404 – paper_trail v0.6.2</title>
<title>404 – paper_trail v0.6.3</title>
<link rel="stylesheet" href="dist/app-a07cea761b.css" />

<link rel="canonical" href="https://hexdocs.pm/paper_trail/404.html" />
Expand All @@ -28,7 +28,7 @@ <h1 class="sidebar-projectName">
paper_trail
</h1>
<h2 class="sidebar-projectVersion">
v0.6.2
v0.6.3
</h2>
</div>

Expand Down
6 changes: 3 additions & 3 deletions doc/Mix.Tasks.Papertrail.Install.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.14.5">
<title>Mix.Tasks.Papertrail.Install – paper_trail v0.6.2</title>
<title>Mix.Tasks.Papertrail.Install – paper_trail v0.6.3</title>
<link rel="stylesheet" href="dist/app-a07cea761b.css" />

<link rel="canonical" href="https://hexdocs.pm/paper_trail/Mix.Tasks.Papertrail.Install.html" />
Expand All @@ -28,7 +28,7 @@ <h1 class="sidebar-projectName">
paper_trail
</h1>
<h2 class="sidebar-projectVersion">
v0.6.2
v0.6.3
</h2>
</div>

Expand Down Expand Up @@ -60,7 +60,7 @@ <h2 class="sidebar-projectVersion">


<h1>
<small class="visible-xs">paper_trail v0.6.2</small>
<small class="visible-xs">paper_trail v0.6.3</small>
Mix.Tasks.Papertrail.Install


Expand Down
6 changes: 3 additions & 3 deletions doc/PaperTrail.Migration.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.14.5">
<title>PaperTrail.Migration – paper_trail v0.6.2</title>
<title>PaperTrail.Migration – paper_trail v0.6.3</title>
<link rel="stylesheet" href="dist/app-a07cea761b.css" />

<link rel="canonical" href="https://hexdocs.pm/paper_trail/PaperTrail.Migration.html" />
Expand All @@ -28,7 +28,7 @@ <h1 class="sidebar-projectName">
paper_trail
</h1>
<h2 class="sidebar-projectVersion">
v0.6.2
v0.6.3
</h2>
</div>

Expand Down Expand Up @@ -60,7 +60,7 @@ <h2 class="sidebar-projectVersion">


<h1>
<small class="visible-xs">paper_trail v0.6.2</small>
<small class="visible-xs">paper_trail v0.6.3</small>
PaperTrail.Migration


Expand Down
6 changes: 3 additions & 3 deletions doc/PaperTrail.RepoClient.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.14.5">
<title>PaperTrail.RepoClient – paper_trail v0.6.2</title>
<title>PaperTrail.RepoClient – paper_trail v0.6.3</title>
<link rel="stylesheet" href="dist/app-a07cea761b.css" />

<link rel="canonical" href="https://hexdocs.pm/paper_trail/PaperTrail.RepoClient.html" />
Expand All @@ -28,7 +28,7 @@ <h1 class="sidebar-projectName">
paper_trail
</h1>
<h2 class="sidebar-projectVersion">
v0.6.2
v0.6.3
</h2>
</div>

Expand Down Expand Up @@ -60,7 +60,7 @@ <h2 class="sidebar-projectVersion">


<h1>
<small class="visible-xs">paper_trail v0.6.2</small>
<small class="visible-xs">paper_trail v0.6.3</small>
PaperTrail.RepoClient


Expand Down
6 changes: 3 additions & 3 deletions doc/PaperTrail.Version.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.14.5">
<title>PaperTrail.Version – paper_trail v0.6.2</title>
<title>PaperTrail.Version – paper_trail v0.6.3</title>
<link rel="stylesheet" href="dist/app-a07cea761b.css" />

<link rel="canonical" href="https://hexdocs.pm/paper_trail/PaperTrail.Version.html" />
Expand All @@ -28,7 +28,7 @@ <h1 class="sidebar-projectName">
paper_trail
</h1>
<h2 class="sidebar-projectVersion">
v0.6.2
v0.6.3
</h2>
</div>

Expand Down Expand Up @@ -60,7 +60,7 @@ <h2 class="sidebar-projectVersion">


<h1>
<small class="visible-xs">paper_trail v0.6.2</small>
<small class="visible-xs">paper_trail v0.6.3</small>
PaperTrail.Version


Expand Down
6 changes: 3 additions & 3 deletions doc/PaperTrail.VersionQueries.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.14.5">
<title>PaperTrail.VersionQueries – paper_trail v0.6.2</title>
<title>PaperTrail.VersionQueries – paper_trail v0.6.3</title>
<link rel="stylesheet" href="dist/app-a07cea761b.css" />

<link rel="canonical" href="https://hexdocs.pm/paper_trail/PaperTrail.VersionQueries.html" />
Expand All @@ -28,7 +28,7 @@ <h1 class="sidebar-projectName">
paper_trail
</h1>
<h2 class="sidebar-projectVersion">
v0.6.2
v0.6.3
</h2>
</div>

Expand Down Expand Up @@ -60,7 +60,7 @@ <h2 class="sidebar-projectVersion">


<h1>
<small class="visible-xs">paper_trail v0.6.2</small>
<small class="visible-xs">paper_trail v0.6.3</small>
PaperTrail.VersionQueries


Expand Down
6 changes: 3 additions & 3 deletions doc/PaperTrail.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.14.5">
<title>PaperTrail – paper_trail v0.6.2</title>
<title>PaperTrail – paper_trail v0.6.3</title>
<link rel="stylesheet" href="dist/app-a07cea761b.css" />

<link rel="canonical" href="https://hexdocs.pm/paper_trail/PaperTrail.html" />
Expand All @@ -28,7 +28,7 @@ <h1 class="sidebar-projectName">
paper_trail
</h1>
<h2 class="sidebar-projectVersion">
v0.6.2
v0.6.3
</h2>
</div>

Expand Down Expand Up @@ -60,7 +60,7 @@ <h2 class="sidebar-projectVersion">


<h1>
<small class="visible-xs">paper_trail v0.6.2</small>
<small class="visible-xs">paper_trail v0.6.3</small>
PaperTrail


Expand Down
6 changes: 3 additions & 3 deletions doc/api-reference.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.14.5">
<title>API Reference – paper_trail v0.6.2</title>
<title>API Reference – paper_trail v0.6.3</title>
<link rel="stylesheet" href="dist/app-a07cea761b.css" />

<link rel="canonical" href="https://hexdocs.pm/paper_trail/api-reference.html" />
Expand All @@ -28,7 +28,7 @@ <h1 class="sidebar-projectName">
paper_trail
</h1>
<h2 class="sidebar-projectVersion">
v0.6.2
v0.6.3
</h2>
</div>

Expand Down Expand Up @@ -60,7 +60,7 @@ <h2 class="sidebar-projectVersion">


<h1>
<small class="visible-xs">paper_trail v0.6.2</small>
<small class="visible-xs">paper_trail v0.6.3</small>
API Reference
</h1>

Expand Down
2 changes: 1 addition & 1 deletion doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>paper_trail v0.6.2 – Documentation</title>
<title>paper_trail v0.6.3 – Documentation</title>
<meta http-equiv="refresh" content="0; url=api-reference.html">
<meta name="robots" content="noindex">
<meta name="generator" content="ExDoc v0.14.5">
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule PaperTrail.Mixfile do
def project do
[
app: :paper_trail,
version: "0.6.2",
version: "0.6.3",
elixir: "~> 1.4",
description: description(),
build_embedded: Mix.env == :prod,
Expand Down

0 comments on commit fba3c64

Please sign in to comment.