[948, 952] Fix Suite.available scope
Resolves #948 (closed), resolves #952 (closed)
- Previously, the left outer joins being used to find available suites meant that any suite that had an archived group assigned to it would be returned, even if it was also assigned to an active group. Rather than deal with an incredibly complex single query, we have chosen to leverage the fact that the inverse query (unavailable suites) is much easier to compose with ActiveRecord and then simply define the available scope as all suites that are not unavailable. This will likely incur some performance cost but at this time it seems like that is worth the increase in reliability and maintainability.
- Also add Suite.unavailable scope
Closes #948 (closed)
Edited by Oren Kanner