Skip to content

Commit

Permalink
small ect odeprecation refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Jul 16, 2016
1 parent c605bf5 commit 9e2b340
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/version.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ defmodule PaperTrail.Version do
timestamps(updated_at: false)
end

@required_fields ~w(event item_type item_id created_at)
@optional_fields ~w(meta)

@doc """
Creates a changeset based on the `model` and `params`.
Expand All @@ -28,6 +25,7 @@ defmodule PaperTrail.Version do
"""
def changeset(model, params \\ :empty) do
model
|> cast(params, @required_fields, @optional_fields)
|> validate_required(~w(event item_type item_id created_at))
|> cast(params, ~w(meta))
end
end

0 comments on commit 9e2b340

Please sign in to comment.