-
Notifications
You must be signed in to change notification settings - Fork 185
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
feat: Use the association options to lookup relationship class #403
feat: Use the association options to lookup relationship class #403
Conversation
Hey @gaorlov 👋 hope you can take a look at this one as well 🙂 thanks in advance! |
@sebasjimenez10 thanks for the contribution! module CrossNamespaceOne
class Hammer < TestResource
property :brand
has_many :nails, class_name: 'CrossNamespaceTwo::Nail'
end
end would that work for your usecase? |
@gaorlov thanks for the response! I went ahead and commented the changes I made to
error. Any ideas on why? I'm happy to try something else! 🙏 |
@gaorlov small bump on this one as well! 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! thanks for contributing!
Please merge in main to get tests running in the PR and please add this PR to the CHANGELOG.md
Thanks!
99d1399
to
036e84b
Compare
@gaorlov thanks for the reply! Merged in main into the branch and added the changelog updates! |
036e84b
to
50b05ab
Compare
@gaorlov small bump! 🙏 |
@sebasjimenez10 I'm on a trip right now, but i will merge and release a new version when I'm back next week. Thank you for your contributions and patience! |
@gaorlov small bump! we're almost there! 🙏 |
hello! |
Hey there,
I'm opening this PR because I noticed an issue with the way the association class types are being looked up when including related resources.
I discovered this when having cross-referenced types when using namespaces, like the example suggests:
In this case whenever the IncludedData class was initializing an instance, the utils class would not be able to produce a correct type to use for the related included type producing an error similar to the following:
Since one should be able to add options to the association definition the
class
option makes sense here. This PR makes use of that to try and figure out the appropriate type before defaulting to the existing behavior.Thanks in advance for taking a look!