I need to count all the microposts of my image where the status is equal to new.
<% for column in @images %>
<%= column.id %>
<%= column.microposts.count() %>
<% end %>
I have tried this line but it doesn't work:
<%= column.microposts.count(" WHERE status='new' ") %>
Is there a way I can add a condition ?