AgileVentures/osra — pull request #83 by NikitaAvvakumov (2014-10-09 11:07:18+00:00)
Title: Fix sponsorship inactivation bug

JIRA https://osraav.atlassian.net/browse/OSRA-175

Bug fix for sponsorship inactivation:

- The original implementation validated that for sponsorships, `[:orphan_id, :active]` had to be unique. This was designed to prevent multiple active sponsorships of the same orphan, but also prevented inactivation of a sponsorship whose orphan had been sponsored previously. i.e. It allowed only one sponsorship record with `[:orphan.id => 1, :active => true]` and only one with `[:orphan.id => 1, :active => false]`.

- The new validation only confirms uniqueness of `[:orphan_id, :active]` for a new record only when `:active => true`.