I'm trying a couple things to find conversations where not all messages have been deleted and it's not working.
Here's one implamentation:
def index
@conversations = @mailbox.conversations.delete_if do |c|
receipts = c.receipts_for @master
return (receipts.where(deleted: true).count == receipts.count)
end
@conversations = @conversations.page(params[:page_1]).per(9)
end
I've also used .find_each instead of delete_if.
Here's the error I'm getting on my view
ActionView::Template::Error (undefined method `first_page?' for nil:NilClass):
Update: I removed return and now its showing:
NoMethodError (undefined method `page' for #):