lib/mongoid/association/relatable.rb
# The class of the association object(s).
#
# This method returns the class instance corresponding to
# +relation_class_name+, resolved relative to the host document class.
#
# If the class does not exist, this method raises NameError. This can
# happen because the target class has not yet been defined. Note that
# polymorphic associations generally do not have a well defined target
# class because the target class can change from one object to another,
# and calling this method on a polymorphic association will generally
# fail with a NameError or produce misleading results (if a class does
# happen to be defined with the same name as the association name).
#
# @return [ String ] The association objects' class.
The class of the association object(s).
This method returns the class instance corresponding to
+relation_class_name+, resolved relative to the host document class.

If the class does not exist, this method raises NameError. This can
happen because the target class has not yet been defined. Note that
polymorphic associations generally do not have a well defined target
class because the target class can change from one object to another,
and calling this method on a polymorphic association will generally
fail with a NameError or produce misleading results (if a class does
happen to be defined with the same name as the association name).
The class of the association object ( s ) . This method returns the class instance corresponding to + relation_class_name + resolved relative to the host document class . If the class does not exist this method raises NameError . This can happen because the target class has not yet been defined . Note that polymorphic associations generally do not have a well defined target class because the target class can change from one object to another and calling this method on a polymorphic association will generally fail with a NameError or produce misleading results ( if a class does happen to be defined with the same name as the association name ) .
def relation_class
        @klass ||= begin
          cls_name = @options[:class_name] || ActiveSupport::Inflector.classify(name)
          resolve_name(inverse_class, cls_name)
        end
      end
def relation_class @klass ||= begin cls_name = @options [ :class_name ] || ActiveSupport :: Inflector . classify ( name ) resolve_name ( inverse_class , cls_name ) end end
The class of the association object(s).
The class of the association object ( s ) .
The association objects' class.
The association objects ' class .
 String 