You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/source/association_basics.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2827,6 +2827,12 @@ class Supplier < ApplicationRecord
2827
2827
end
2828
2828
```
2829
2829
2830
+
Extensions can refer to the internals of the association proxy using these three attributes of the `proxy_association` accessor:
2831
+
2832
+
*`proxy_association.owner` returns the object that the association is a part of.
2833
+
*`proxy_association.reflection` returns the reflection object that describes the association.
2834
+
*`proxy_association.target` returns the associated object for `belongs_to` or `has_one`, or the collection of associated objects for `has_many` or `has_and_belongs_to_many`.
2835
+
2830
2836
### Association Scoping using the Association Owner
2831
2837
2832
2838
The owner of the association can be passed as a single argument to the scope
0 commit comments