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

Mixin CollectionProxy::DelegateExtending after ClassSpecificRelation #28828

Merged

Conversation

kamipo
Copy link
Member

@kamipo kamipo commented Apr 22, 2017

ClassSpecificRelation has method_missing and the method_missing is
called first. if an associated class has the missing method in a
relation, never reach to the method_missing in the CollectionProxy.
I extracted DelegateExtending and included it to the delegate class
that including ClassSpecificRelation to fix the issue.

Fixes #28246 (comment).

`ClassSpecificRelation` has `method_missing` and the `method_missing` is
called first. if an associated class has the missing method in a
relation, never reach to the `method_missing` in the `CollectionProxy`.
I extracted `DelegateExtending` and included it to the delegate class
that including `ClassSpecificRelation` to fix the issue.

Fixes rails#28246 (comment).
@kamipo kamipo force-pushed the fix_extending_modules_on_association branch from f515b7f to 22fa48f Compare April 22, 2017 02:07
@rafaelfranca rafaelfranca merged commit a3c7fe0 into rails:master Apr 26, 2017
rafaelfranca added a commit that referenced this pull request Apr 26, 2017
…ation

Mixin `CollectionProxy::DelegateExtending` after `ClassSpecificRelation`
rafaelfranca added a commit that referenced this pull request Apr 26, 2017
…ation

Mixin `CollectionProxy::DelegateExtending` after `ClassSpecificRelation`
@rafaelfranca
Copy link
Member

Backported in b73e1c4 and 69c49f1

@kamipo kamipo deleted the fix_extending_modules_on_association branch April 26, 2017 03:41
rafaelfranca added a commit that referenced this pull request May 15, 2017
…n_association"

This reverts commit 69c49f1.

Revert "Revert "Revert "Merge pull request #28246 from pwim/backport_delegate_to_scope_rather_than_merge"""

This reverts commit 7dba3f1.

See #28246 (comment) for
the reason.
rafaelfranca added a commit that referenced this pull request May 15, 2017
…odules_on_association""

This reverts commit d6679af.

We already released this commit so we can't just revert anymore.
rafaelfranca added a commit to rafaelfranca/omg-rails that referenced this pull request May 15, 2017
…x_extending_modules_on_association"""

This reverts commit 9d7f526.
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.

None yet

3 participants