Skip to content

Commit

Permalink
Allow overriding __from_json_list__/2 in Model
Browse files Browse the repository at this point in the history
This allows overriding the root-level key in the json response for scenarios where the array of records is nested inside of an attribute, such as `data`.
  • Loading branch information
jcypret committed Sep 11, 2016
1 parent 7be2be5 commit fde6144
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dayron/model.ex
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ defmodule Dayron.Model do

def __from_json_list__(data, _opts), do: struct(__MODULE__, data)

defoverridable [__url_for__: 1, __from_json__: 2]
defoverridable [__url_for__: 1, __from_json__: 2, __from_json_list__: 2]
end
end

Expand Down

0 comments on commit fde6144

Please sign in to comment.