title: Rails determine if association is has_one or has_many
body: <p>Wondering if there is an easy way to determine dynamically if a model's association is a "<code>has_one</code>" or "<code>has_many</code>" relationship (i.e. is this an association to one object or many).</p>
  
  <p>I'm using MongoMapper, so I am able to check if a class <code>klass</code> has an associated model <code>assoc</code> with a one or many relationship via</p>
  
  <pre><code>klass.associations[:assoc].is_a? MongoMapper::Plugins::Associations::OneAssociation
  klass.associations[:assoc].is_a? MongoMapper::Plugins::Associations::ManyAssociation
  </code></pre>
  
  <p>but this seems rather clunky, and isn't generic (i.e. won't work for <code>ActiveRecord</code> associations as well). I'd also like to avoid loading any objects, so I'm pretty sure that <code>instance.assoc.is_a? Array</code> is out too.</p>
  
  <p>Any ideas?</p>