Skip to content

Commit

Permalink
[DOCS has-many]: clarify load/reload behavior
Browse files Browse the repository at this point in the history
I was bit hard by this. I expected that calling either of these methods would re-query the relationship through the adapter. This isn't the case. I further understood what was going on reading the source while implementing my own adapters. This commit hopefully clarifies the behavior. If the relationship has a "link", then `findHasMany` is called to re-query the relationship. Otherwise, all existing records are reload.
  • Loading branch information
Adam Hawkins authored Nov 2, 2018
1 parent c466ae8 commit aa87a0a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions addon/-private/system/references/has-many.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ export default class HasManyReference extends Reference {
/**
Loads the relationship if it is not already loaded. If the
relationship is already loaded this method does not trigger a new
load.
load. This causes a request to the specified
relationship link or reloads all items currently in the relationship.
Example
Expand Down Expand Up @@ -318,7 +319,8 @@ export default class HasManyReference extends Reference {
}

/**
Reloads this has-many relationship.
Reloads this has-many relationship. This causes a request to the specified
relationship link or reloads all items currently in the relationship.
Example
Expand Down

0 comments on commit aa87a0a

Please sign in to comment.