method
association_class
v4.1.8 -
Show latest stable
- Class:
ActiveRecord::Reflection::AssociationReflection
association_class()public
No documentation available.
# File activerecord/lib/active_record/reflection.rb, line 370
def association_class
case macro
when :belongs_to
if options[:polymorphic]
Associations::BelongsToPolymorphicAssociation
else
Associations::BelongsToAssociation
end
when :has_many
if options[:through]
Associations::HasManyThroughAssociation
else
Associations::HasManyAssociation
end
when :has_one
if options[:through]
Associations::HasOneThroughAssociation
else
Associations::HasOneAssociation
end
end
end