title: Find if a collection of objects have the same value for a given attribute
body: <p>I have two related models : <code>Invoice</code> and <code>Currency</code>.</p>
  
  <p><code>Invoice belongs_to Currency</code> and <code>Currency has_many Invoices</code></p>
  
  <p>I have a table which displays the list of every invoices and I am able to filter them by currency. An invoice also has a <code>price</code>field and I have a method which calculates the total price of invoices I display.</p>
  
  <p>My problem is that I want to display the total price if and only if every invoices have the same currency.</p>
  
  <p>I am pretty sure there is a simple way to achieve this but I can't find it out.</p>
  
  <p>Any help would be greatly appreciated.</p>