alphagov/whitehall — comment on commit 57b2fdb5780aca5b572862e414e945ee7d1f6a5a
File:  line 0
By tomafro:

Not sure I understand how this defines relationships in controllers. Is there much difference between:

@policies = Policy.published.in_topic(@topic)

And:

@policies = @topic.policies.published

I guess the controller now has to know about the `Policy` model which isn't great, but I think it's a price worth paying for a simpler `Topic` model. I can see the attraction of having `@topic.published_policies`, but that's really unflexible, as you'd need to define states * document types relationships just to avoid an extra dot.

One thing I would be interested in looking into is some sort of decorator for `PublicTopic` that defines `policies` and other similar methods.