FIX: where("association_id", id) leads to invalid statement in postgres. where should just be given a hash.
test for issue #185
Slightly more readable spec

Change-Id: Ib73e43a5adcb8bd9b5bbf5b7ca60f9865e5415e7