title: Rails 4.0 undefined method `call'
body: <p>I have a rails app whereby I'm creating a highcharts line graph to compare stocks in 2 industries, Telecommunication and Agriculture while following <a href="http://railscasts.com/episodes/223-charts" rel="nofollow">this</a>, ryan bates highstocks video.</p>
  
  <p>The graph will be output in a view, index.html.erb of stock_quotes whereby the javascipt code for highcharts is as follows:</p>
  
  <pre><code>&lt;div id="quotes_chart", style="width=560px; height:300px;"&gt;
  
    $(function(){   
    new HighCharts.Chart( 
    chart: {
      renderTo: "quotes_chart"
    },
    title: {
     text: "Daily trades" 
    },
    xAxis: {
     type: "datetime"
    },
    yAxis: {
     title: {
       text: "Shillings"
    }
  },
  tooltip: {
    formatter: function(){
      return HighCharts.dateFormat("%B %e, %Y", this.x) + ': ' + "Kshs" + Highcharts.numberFormat(this.y, 2);
    }
  },
  series: [
  &lt;% { "Telecommunication" =&gt; StockQuote.telecomm, "Agriculture" =&gt; StockQuote.agric }.each do |name, prices|
  %&gt;
  {
    name: &lt;%= name %&gt;
    pointInterval: &lt;%= 1.day * 1000 %&gt;,
    pointStart: &lt;%= 2.weeks.ago.to_i * 1000 %&gt;,
    data: &lt;%= (2.weeks.ago.to_date..Date.today).map { |date| StockQuote.price_on(date).to_f}.inspect%&gt;
  },
  &lt;% end %&gt;]
    }); 
  }); 
   &lt;/div&gt;
  </code></pre>
  
  <p>The model <strong>stock_quote.rb</strong> is as follows:</p>
  
  <pre><code>scope :agric, where(category: "Agriculture")
  scope :telecomm, where(category: "Telecommunication")
  
  def self.price_on(date)
    where("date(published_at) = ?", date).sum(:total_price)
  end
  </code></pre>
  
  <p>This is what is being output on the stock_quotes div:</p>
  
  <pre><code>$(function(){ new HighCharts.Chart( chart: { renderTo: "quotes_chart" }, title: { text: "Daily trades" }, xAxis: { type: "datetime" }, yAxis: { title: { text: "Shillings" } }, tooltip: { formatter: function(){ return HighCharts.dateFormat("%B %e, %Y", this.x) + ': ' + "Kshs" + Highcharts.numberFormat(this.y, 2); } }, series: [ { name: Telecommunication pointInterval: 86400000, pointStart: 1398157330000, data: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 554.0] }, { name: Agriculture pointInterval: 86400000, pointStart: 1398157330000, data: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 554.0] }, ] }); }); 
  </code></pre>