Next generation associations
Support defining a class and method to find associated object
Support defining a class and finding multiple related objects
- Arbitrary item
Support finding N arbitrary objects related to the querying object
- Automagically inferring inverse relationships.
class User corresponds_with :profile end
This will create a
profile method on any instance of the user class. By
profile method will call
id is a
method on the user class.
:class_namespecify a string for the association class name.
:classallows specifying a string, class, symbol or proc. Symbols must be class methods on the associating class, procs should resolve to the association class.
:ona symbol or string specifying the method that should be called on the associating class as a reference to the association. Defaults to
:usinga symbol or string that is the method that will be called on the association call. This method will be passed the results of
:on. Defaults to