title: Find records where length of array equal to - Rails 4
body: <p>In my <code>Room</code> model, I have an attribute named <code>available_days</code>, which is being stored as an array. </p>
  
  <p>For example:</p>
  
  <pre><code>Room.first.available_days
  =&gt; ["wed", "thurs", "fri"]
  </code></pre>
  
  <p>What is the best way to find all Rooms where the size of the array is equal to 3?</p>
  
  <p>I've tried something like</p>
  
  <pre><code>Room.where('LENGTH(available_days) = ?', 3)
  </code></pre>
  
  <p>with no success. </p>
  
  <p><strong>Update:</strong> the data type for <code>available_days</code> is a string, but in order to store an array, I am serializing the attribute from my model:</p>
  
  <p>app/models/room.rb</p>
  
  <pre><code>serialize  :available_days
  </code></pre>