Skip to content

Commit

Permalink
Remove View.hidden/0
Browse files Browse the repository at this point in the history
  • Loading branch information
jherdman committed Jan 25, 2019
1 parent d16670e commit 8d6e044
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
7 changes: 0 additions & 7 deletions lib/jsonapi/deprecation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ defmodule JSONAPI.Deprecation do
)
end

def warn(:hidden) do
IO.warn(
"`JSONAPI.View.hidden/0` is deprecated; use `JSONAPI.View.hidden/1` instead.",
Macro.Env.stacktrace(__ENV__)
)
end

def warn(:query_parser_dash) do
IO.warn(
"`JSONAPI.QueryParser` will no longer automatically dasherize incoming parameters. Please include `JSONAPI.UnderscoreParameters` in your pipeline. See https://github.com/jeregrine/jsonapi/pull/149",
Expand Down
9 changes: 1 addition & 8 deletions lib/jsonapi/view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,7 @@ defmodule JSONAPI.View do
end

def attributes(data, conn) do
hidden =
if Enum.member?(__MODULE__.__info__(:functions), {:hidden, 0}) do
JSONAPI.Deprecation.warn(:hidden)
this = __MODULE__
this.hidden()
else
hidden(data)
end
hidden = hidden(data)

visible_fields = fields() -- hidden

Expand Down
2 changes: 1 addition & 1 deletion test/jsonapi/view_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ defmodule JSONAPI.ViewTest do
"#{user.first_name} #{user.last_name}"
end

def hidden do
def hidden(_data) do
[:password]
end
end
Expand Down

0 comments on commit 8d6e044

Please sign in to comment.