Hi Andy,
I want to get abandoned Issues that have no open offer and no open contract.
I came up with the following code:
issues_not_abandoned = []
issues_contracted = Contract.joins(:issue).open.where('issues.stm_status = ?', 'open').pluck('stm_issue_uuid')
issues_not_abandoned.concat(issues_contracted)
issues_offered = Offer.joins(:issue).open.where('issues.stm_status = ?', 'open').pluck('stm_issue_uuid')
issues_not_abandoned.concat(issues_offered)
abandoned_issue_count = Issue.open.where('uuid NOT IN (?)', issues_not_abandoned).count
However, it appears that offers, who's maturation date passed, are still considered 'open'. and not expired.
Feature, Bug, or do I not understand something?
Best,
Georg