Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ erl_crash.dump
# Ignore package tarball (built via "mix hex.build").
ecto_diff-*.tar

# ignore local plts
# Ignore local plts.
/priv/plts/*.plt
/priv/plts/*.plt.hash
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)
# The MIT License (MIT)

Copyright 2019 Peek Travel, Inc.
Copyright (c) 2019 Peek Travel, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

[![CI Status](https://github.com/peek-travel/ecto_diff/workflows/CI/badge.svg)](https://github.com/peek-travel/ecto_diff/actions)
[![codecov](https://codecov.io/gh/peek-travel/ecto_diff/branch/master/graph/badge.svg)](https://codecov.io/gh/peek-travel/ecto_diff)
[![SourceLevel](https://app.sourcelevel.io/github/peek-travel/ecto_diff.svg)](https://app.sourcelevel.io/github/peek-travel/ecto_diff)
[![Hex.pm Version](https://img.shields.io/hexpm/v/ecto_diff.svg?style=flat)](https://hex.pm/packages/ecto_diff)
[![License](https://img.shields.io/hexpm/l/ecto_diff.svg)](LICENSE.md)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=peek-travel/ecto_diff)](https://dependabot.com)
[![Module Version](https://img.shields.io/hexpm/v/ecto_diff.svg)](https://hex.pm/packages/ecto_diff)
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/ecto_diff/)
[![Total Download](https://img.shields.io/hexpm/dt/ecto_diff.svg)](https://hex.pm/packages/ecto_diff)
[![License](https://img.shields.io/hexpm/l/ecto_diff.svg)](https://github.com/peek-travel/ecto_diff/blob/master/LICENSE.md)
[![Last Updated](https://img.shields.io/github/last-commit/peek-travel/ecto_diff.svg)](https://github.com/peek-travel/ecto_diff/commits/master)

Generates a data structure that describes the differences between two [ecto](https://github.com/elixir-ecto/ecto) structs.
Generates a data structure that describes the differences between two [Ecto](https://github.com/elixir-ecto/ecto) structs.
The primary use-case is to track what changed after calling `Repo.insert` or `Repo.update`, especially in conjunction
with complex or deeply nested `cast_assoc` associations.

## Installation

The package can be installed by adding `ecto_diff` to your list of dependencies in `mix.exs`:
The package can be installed by adding `:ecto_diff` to your list of dependencies in `mix.exs`:

```elixir
def deps do
Expand Down Expand Up @@ -134,3 +135,11 @@ iex> EctoDiff.diff(initial_pet, updated_pet)
```

Detailed documentation can be found at [https://hexdocs.pm/ecto_diff](https://hexdocs.pm/ecto_diff).


## Copyright and License

Copyright (c) 2019 Peek Travel, Inc.

This work is free. You can redistribute it and/or modify it under the
terms of the MIT License. See the [LICENSE.md](./LICENSE.md) file for more details.
2 changes: 1 addition & 1 deletion lib/ecto_diff.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule EctoDiff do
@moduledoc """
Generates a data structure describing the difference between two ecto structs.
Generates a data structure describing the difference between two Ecto structs.

For details on how to generate an `t:EctoDiff.t/0` struct, see: `diff/2`.

Expand Down
9 changes: 7 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ defmodule EctoDiff.MixProject do

defp docs do
[
main: "EctoDiff",
extras: [
"CHANGELOG.md": [],
"LICENSE.md": [title: "License"],
"README.md": [title: "Overview"]
],
main: "readme",
source_ref: @version,
source_url: @source_url,
extras: ["README.md", "CHANGELOG.md", "LICENSE.md"]
formatters: ["html"]
]
end

Expand Down