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

Allow users to globally opt out of automatic serializer lookup #1353

Merged
merged 3 commits into from
Dec 21, 2015

Conversation

bf4
Copy link
Member

@bf4 bf4 commented Nov 30, 2015

Closes #1295

@bf4
Copy link
Member Author

bf4 commented Nov 30, 2015

@trek does this work for you?

@beauby
Copy link
Contributor

beauby commented Dec 9, 2015

One possible solution is to simply monkey-patch ActiveModel::Serializer's serializer_lookup_chain_for method to return an empty array.

@trek
Copy link
Contributor

trek commented Dec 20, 2015

Sorry for taking so long to verify this. Just bundled and ran our suite. Totally works.

@trek
Copy link
Contributor

trek commented Dec 20, 2015

I've closed #1295 in favor of this.

bf4 added a commit that referenced this pull request Dec 21, 2015
Allow users to globally opt out of automatic serializer lookup
@bf4 bf4 merged commit 30fd9d9 into rails-api:master Dec 21, 2015
@bf4 bf4 deleted the disable_serializer_lookup branch December 21, 2015 02:04
@bf4
Copy link
Member Author

bf4 commented Dec 21, 2015

Merged!

@trek
Copy link
Contributor

trek commented Jan 7, 2016

So, it turns out there are some subtle differences between this and #1295. This ignores custom adapter configured with ActiveModel::Serializer.config.adapter when serializing associations inside the root object and reverts to the default, so you get mixed serialization.

@bf4
Copy link
Member Author

bf4 commented Jan 7, 2016

weird. Can you provide some failing data for that?

@trek
Copy link
Contributor

trek commented Feb 6, 2016

@bf4 sorry for the delay: #1500

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

Successfully merging this pull request may close these issues.

3 participants