<% @training_dates.reverse.each do |t| %>
<% if t.candidate_limit != Subscription.group(:training_date_id).count[t.id] %>
<%= t.name %>
<% end %>
<% end %>
I want to turn this if
statement into a scope so I can do @training_dates.(scope).reverse.each
.