def references(*args)
      options = args.extract_options!

      if options.has_key?(:as_ref)
        references_by_dbref(options[:as_ref])
      else
        klass = args[0].to_s.camelize
        references_by_id(klass, options[:as] || klass.to_s.demodulize.underscore)
      end
    end
def references(*args)
      options = args.extract_options!

      if options.has_key?(:as_ref)
        references_by_dbref(options[:as_ref])
      else
        klass = args[0].to_s.camelize
        references_by_id(klass, options[:as] || klass.to_s.demodulize.underscore)
      end
    end
Declare a reference to another +Document+. The reference can either be an
 +ObjectId+ reference, or a +BSON::DBRef+

 Use an +ObjectId+ reference when you have a simple reference or will be
 referencing a single polymorphic collection. Example:

 +references :address
 +references :address, :as => :work_address+

 * classname:: name of +Document+ type as an +underscore+ symbol or string
 * options:: +:as+ specifies the name of the attribute, defaults to
 classname

 Use a +BSON::DBRef+ when you need a reference to multiple collections.
 Example:

 +references :as_ref => :work_address+

 * options:: +:as_ref+ name of the attribute