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

Replace Struct subclassing with block-form initialization #972

Merged
merged 1 commit into from
Jan 31, 2018

Conversation

bobziuchkovski
Copy link
Contributor

@bobziuchkovski bobziuchkovski commented Jun 2, 2017

Replace the Struct subclassing with block-form initialization. According to the the docs, "This is the recommended way to customize a struct. Subclassing an anonymous struct creates an extra anonymous class that will never be used."

This fixes an issue we're seeing downstream in our rails project when using doorkeeper with Spring/Bootsnap. The subclassing pattern results in differing class hierarchies when the code is loaded:

/usr/local/opt/rbenv/versions/2.3.4/gemsets/app/gems/doorkeeper-4.2.0/lib/doorkeeper/oauth/client/credentials.rb:4:in `class:Client': superclass mismatch for class Credentials (TypeError)

@maclover7
Copy link
Member

Hi @bobziuchkovski! Can you add a note about this in the NEWS.md file?

@nbulaj
Copy link
Member

nbulaj commented Jan 26, 2018

Hi @bobziuchkovski . What about NEWS.MD? Looks good, but can you add a new entry to changelog?

@nbulaj nbulaj self-assigned this Jan 26, 2018
@nbulaj nbulaj merged commit c69fdd3 into doorkeeper-gem:master Jan 31, 2018
@nbulaj
Copy link
Member

nbulaj commented Jan 31, 2018

Seems like there would not be an answer (no topicstarter activity), so I decided to merge it myself. Thanks

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