Skip to content

Conversation

@smaximov
Copy link
Contributor

This should resolve #24

@smaximov smaximov changed the title Fix the shortcut form of render Fix the shortcut form of #render May 23, 2017
Copy link
Member

@beauby beauby left a comment

Choose a reason for hiding this comment

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

LGTM

# @api private
def rails_renderer(renderer)
proc do |json, options|
reverse_mapping = request.env[ActionController::REVERSE_MAPPING_KEY]
Copy link
Member

Choose a reason for hiding this comment

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

Would you mind adding a comment stating that the proc is instance_eval'd in the controller context? It will simplify debugging in case this assumption is broken by rails at some point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I squash commits?

@beauby
Copy link
Member

beauby commented May 25, 2017

Thanks, merging!

@beauby beauby merged commit ee3acf6 into jsonapi-rb:master May 25, 2017
@smaximov smaximov deleted the fix/render/proc branch May 26, 2017 08:49
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.

jsonapi-rails breaks the shortcut form of ActionController#render

2 participants