Skip to content

Commit

Permalink
some compiler warnings removed
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Jul 16, 2016
1 parent 64e8c7e commit 29de7ca
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/mix/tasks/papertrail/install.ex
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
defmodule Mix.Tasks.Papertrail.Install do
@shortdoc "generates paper_trail migration file for your database"

import Macro, only: [camelize: 1, underscore: 1]
import Macro, only: [underscore: 1]
import Mix.Generator

use Mix.Task

def run(args) do
def run(_args) do
path = Path.relative_to("priv/repo/migrations", Mix.Project.app_path)
file = Path.join(path, "#{timestamp()}_#{underscore(AddVersions)}.exs")
create_directory path
Expand Down
5 changes: 2 additions & 3 deletions lib/paper_trail.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
defmodule PaperTrail do
import Ecto.Query
import PaperTrail.VersionQueries

alias Ecto.Multi
alias PaperTrail.Version

Expand All @@ -24,7 +23,7 @@ defmodule PaperTrail do
def update(changeset, meta \\ nil) do
Multi.new
|> Multi.update(:model, changeset)
|> Multi.run(:version, fn %{model: model} ->
|> Multi.run(:version, fn %{model: _model} ->
version = make_version_struct(%{event: "update"}, changeset, meta)
Repo.insert(version)
end)
Expand Down
2 changes: 0 additions & 2 deletions lib/version.ex
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
defmodule PaperTrail.Version do
use Ecto.Schema

import Ecto
import Ecto.Changeset
import Ecto.Query

schema "versions" do
field :event, :string
Expand Down
1 change: 1 addition & 0 deletions test/test_helper.exs
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ end
Repo.start_link

ExUnit.configure seed: 0

ExUnit.start()

0 comments on commit 29de7ca

Please sign in to comment.