-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fixing includes
to properly build and set the association.
#12
Fixing includes
to properly build and set the association.
#12
Conversation
…izes the `relationship_name`. Also fixed a test that was expecting a thing to be cached but was not ever added to the `includes`... curious how that test was passing before.
includes
to properly build and set the associa…includes
to properly build and set the association.
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 good to me ... do you need to bump the patch version?
Yeah, good call. I'll also update the |
…n because our `table_name` may not match the capitalization of the SF relationship field.
…siness rules say it is a `has_one` we will end up with an array of 1. This will guard against that unlikely scenario.
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.
@@ -1,8 +1,17 @@ | |||
module ActiveForce | |||
module Association | |||
class BelongsToAssociation < Association | |||
|
|||
def relationship_name | |||
options[:relationship_name] || default_relationship_name |
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.
👍
Prior to this fix
ActiveForce::ActiveQuery
would properly fetch the associated records but would not know how to assign them so referencing the association would result in another query to Salesforce. We added a mapping of Salesforce relation names to the defined association name to accomplish this.