include meta as top level document member#97
include meta as top level document member#97doomspork merged 2 commits intobeam-community:masterfrom
Conversation
|
Another thought is ensure a user defines a key to put on the |
d30e5b8 to
8443c10
Compare
snewcomer
left a comment
There was a problem hiding this comment.
I tried this branch out and works like I was expecting.
| if Code.ensure_loaded?(Phoenix) do | ||
| def render("show.json", %{data: data, conn: conn, params: params, meta: meta}), | ||
| do: show(data, conn, params, meta: meta) | ||
| def render("show.json", %{data: data, conn: conn, meta: meta}), |
There was a problem hiding this comment.
One unrelated curiosity:
If I define a render function in my controller, how does the conn parameter get in there?
render(conn, "index.json", %{data: my_list, meta: meta})
There was a problem hiding this comment.
conn is always merged into the assigns data, because the view doesn't mutate/return a conn its treated as data instead of the subject of the function.
7479c6b to
2514af4
Compare
|
@jeregrine Looks like 18.3 is failing here and on master. Only on elixir 1.6 is otp 18 not supported. Would you like me to remove https://travis-ci.org/jeregrine/jsonapi/jobs/347070137 |
|
Yea we just need to update the travis matrix a good example is
https://github.com/getsentry/sentry-elixir/blob/master/.travis.yml
…On Mon, Mar 5, 2018 at 11:46 AM, Scott Newcomer ***@***.***> wrote:
@jeregrine <https://github.com/jeregrine> Looks like 18.3 is failing here
and on master. Only on elixir 1.6 is otp 18 not supported. Would you like
me to remove 18.3 from travis? Or is there another way to do this?
https://github.com/elixir-lang/elixir/blob/master/lib/
elixir/pages/Compatibility%20and%20Deprecations.md#
compatibility-between-elixir-and-erlangotp
https://travis-ci.org/jeregrine/jsonapi/jobs/347070137
https://travis-ci.org/jeregrine/jsonapi/jobs/346951834
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#97 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAGKFnjK52P43bFQdQlCA1hCFXnYdKwGks5tbXoKgaJpZM4SSa0_>
.
|
|
@snewcomer could you squash your commits to re-trigger Travis? 😁 |
02b64c3 to
f14a89f
Compare
f14a89f to
bcd914d
Compare
|
@jeregrine do you want me to cut a new release? |
|
I trust your judgement here :) |
This PR adds the ability to pass a
metamap to the render function.The current functionality relies on the meta data to be present on the
dataattribute. However, for example, on index routes,datais simply a List and some attributes to filter/paginate the list may need to be passed through to the response that aren't implicitly included/apart of thedata.Lmk your thoughts!
Ref #96