At this point, there is no way to use array relationships in Rails. However, using the selected answer, you will encounter the problem of choosing N + 1. Let's say you receive your messages, and then the tags for it at each post with the "tags" method defined in the class. For each message that you call in tags, you will suffer a different database hit.
I hope that this will change in the future, and we can get rid of the connection table (especially considering that Postgres 9.4 will include support for foreign keys in arrays).
source share