title: How to fix the error: PG::AmbiguousColumn: ERROR: column reference "created_at" is ambiguous
body: <p>This issue started all of a sudden. Never seen before. Error was raised at below code.</p>
  
  <p>I tried to replace @events.group_by_day(:created_at) with "@events.created_at" and reloaded console. but nothing seems to work.</p>
  
  <pre><code>...
  &lt;%= line_chart @events.group(:category_id).group_by_day(:created_at).count, id: 'event_line_chart' %&gt;
  ...
  </code></pre>
  
  <p>application.html.erb:</p>
  
  <pre><code>...
  &lt;%= csrf_meta_tags %&gt;
  &lt;%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload' %&gt;
  &lt;%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %&gt;
    &lt;%= stylesheet_link_tag    '//cdnjs.cloudflare.com/ajax/libs/authy-forms.css/2.2/form.authy.min.css', media: 'all', 'data-turbolinks-track' =&gt; true %&gt;
   &lt;%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' =&gt; true %&gt;
   &lt;%= javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/authy-forms.js/2.2/form.authy.min.js', 'data-turbolinks-track' =&gt; true %&gt;
   &lt;%= javascript_include_tag 'application', 'data-turbolinks-track' =&gt; true %&gt;
   ...
  </code></pre>
  
  <p>Expected to show the page but getting above error. Please help me with this</p>