Skip to content

Allow "if: Proc..." on link#442

Open
listrophy wants to merge 1 commit intoNetflix:devfrom
listrophy:allow-links-to-be-optional
Open

Allow "if: Proc..." on link#442
listrophy wants to merge 1 commit intoNetflix:devfrom
listrophy:allow-links-to-be-optional

Conversation

@listrophy
Copy link

Just like attribute, this PR allows the dev to specify links as follows:

link(:download, if: ->(obj, params) { params && params[:signed_url] }) do |obj, params|
  params[:signed_url]
end

@jopotts
Copy link

jopotts commented Oct 7, 2019

Looks like an improvement. You're welcome to add the PR here too: jsonapi-serializer/jsonapi-serializer#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants