Netflix / fast_jsonapi

No Longer Maintained - A lightning fast JSON:API serializer for Ruby Objects.
Apache License 2.0
5.07k stars 425 forks source link

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

Open listrophy opened 4 years ago

listrophy commented 4 years ago

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 commented 4 years ago

Looks like an improvement. You're welcome to add the PR here too: https://github.com/fast-jsonapi/fast_jsonapi/issues/1