Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use return value of link block if any #2

Merged

Conversation

bf4
Copy link
Collaborator

@bf4 bf4 commented Dec 30, 2015

This commit leaves unresolved the behavior if there is both a return value to the block (as _string) and meta and/or href are set. To be decided in the receiving PR if merged.

@@ -10,29 +10,40 @@ def initialize(serializer)

def href(value)
self._href = value
nil
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for an explicit nil return value?

beauby added a commit that referenced this pull request Dec 31, 2015
Use return value of link block if any
@beauby beauby merged commit 88e5e50 into beauby:dynamic-jsonapi-string-links Dec 31, 2015
@beauby
Copy link
Owner

beauby commented Dec 31, 2015

Merged 👍

beauby pushed a commit that referenced this pull request Apr 14, 2016
One of three constituents is used to provide the
CollectionSerializer's #json_key:

1) the :root option - controlled by the caller
2) the #name of the first resource serializer - the root or
   underscored model name
3) the underscored #name of the resources object - generally
   equivalent to the underscored model name of #2

Of the three, only the latter 2 are out of the callers control, and
only the latter two are expected to be singular by default. Not
pluralizing the root gives the caller additional flexibility in
defining the desired root, whether conventionally plural,
unconventionally plural (e.g. objects_received:) or singular.
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