title: how to fetch all dates as array from database in ruby?
body: <p>I have a holiday_list table with column names occasion and date. I show the list of holidays according to current year.</p>
  
  <pre><code>class HolidayListsController &lt; ApplicationController
  def index
      @holidays = HolidayList.by_year(Time.now.year)
  end
  end
  </code></pre>
  
  <p>query in model method like this:-</p>
  
  <pre><code>def self.by_year(year)
    where('extract(year from date) = ?', year)
  end
  </code></pre>
  
  <p>from above code i get whole data as array in result</p>
  
  <pre><code> &lt;ActiveRecord::Relation [#&lt;HolidayList id: 1, name: "independence day", date: "2015-08-15",created_at: "2015-06-04 07:19:02", 
      updated_at: "2015-06-04 07:19:02"&gt;, #&lt;HolidayList id: 2, name: "Republic day",date: "2015-01-26", created_at: "2015-06-04 08:39:57",
      updated_at: "2015-06-04 08:39:57"&gt;
  </code></pre>
  
  <p>but I want all values of date column as an array.so that i can apply this array in my jQuery.</p>