reflect_on_all_associations(macro = nil)
With this method, you can return an Array of all the AssociationReflection objects for the
associations in this class. If you only want the associations of a specific type, specify its symbol
in a macro. The valid types are :has_many, :belongs_to, :has_one, or :has_and_belongs_to_many.
reflect_on_association(association)
Return the AssociationReflection object for the named reflection specified by association
with this method.
reflections()
Use this method to return a Hash containing all of the AssociationReflection and
AggregateReflection objects for the class.
APPENDIX ?– ACTIVE RECORD METHODS IN DETAIL 251
ActiveRecord::Reflection::MacroReflection
Public Class Methods
new(macro, name, options, active_record)
This new method creates a new reflection class with the given macro, name, and options.
class_name()
Return the class name of this reflection class with this item.
klass()
klass returns the class for the reflection.
macro()
macro returns the name of the macro that this reflection represents.
Pages:
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550