<% start = Time.now %>
<table border="1">
  <thead>
    <tr>
      <th>
        id
      </th>
      <th>
        replies_count
      </th>
      <th>
        in_reply_to.id
      </th>
      <th>
        in_reply_to.favorites_count
      </th>
    </tr>
  </thead>
  <tbody>
    <% @tweets.each do |tweet| %>
      <tr>
        <td>
          <%= tweet.id %>
        </td>
        <td>
          <%= eager_load? ? tweet.replies_count : tweet.replies.count %>
        </td>
        <td>
          <%= tweet.in_reply_to.try(:id) %>
        </td>
        <td>
          <%= tweet.in_reply_to.try(:favorites_count) %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
<% finish = Time.now %>

<p>
  <%= eager_load? ? 'Eager loaded' : 'N+1 query' %>
</p>
<p>
  Time: <%= "%.1f" % ((finish - start) * 1000) %>ms
</p>

<p>
  <%= link_to 'Swtich', url_for(eager_load: !eager_load?) %>
<p>

<% start = Time.now %>
<table border="1">
  <thead>
    <tr>
      <th>
        id
      </th>
      <th>
        replies_count
      </th>
      <th>
        in_reply_to.id
      </th>
      <th>
        in_reply_to.favorites_count
      </th>
    </tr>
  </thead>
  <tbody>
    <% @tweets.each do |tweet| %>
      <tr>
        <td>
          <%= tweet.id %>
        </td>
        <td>
          <%= tweet.replies.count %>
        </td>
        <td>
          <%= tweet.in_reply_to.try(:id) %>
        </td>
        <td>
          <%= tweet.in_reply_to.try(:favorites_count) %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
<% finish = Time.now %>

<p>
  <%= eager_load? ? 'Eager loaded' : 'N+1 query' %>
</p>
<p>
  Time: <%= "%.1f" % ((finish - start) * 1000) %>ms
</p>

<p>
  <%= link_to 'Swtich', url_for(eager_load: !eager_load?) %>
<p>

Fix sample app view method call
Fix sample app view method call
