title: Rails: better way to check for associated object by name
body: <p>I have the following method in my Product model:</p>
  
  <pre><code>def has_feature? (feature_name)
    self.features.where(:name=&gt;feature_name).present?
  end
  </code></pre>
  
  <p>This seems to be very slow. Is there a better way of checking to see if my product has a feature with a given name?</p>