method
association_class
v3.2.1 -
Show latest stable
- Class:
ActiveRecord::Reflection::AssociationReflection
association_class()public
No documentation available.
# File activerecord/lib/active_record/reflection.rb, line 323
def association_class
case macro
when :belongs_to
if options[:polymorphic]
Associations::BelongsToPolymorphicAssociation
else
Associations::BelongsToAssociation
end
when :has_and_belongs_to_many
Associations::HasAndBelongsToManyAssociation
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