Clever use of Rails associations