I'm not quite sure how to word this but I'll give it a shot.
Basically I have two models: Message and Event.
Message belongs_to event and event has_many messages.
When I call something like:
Event.first.messages
It produces this output:
SELECT "messages".* FROM "messages" WHERE "messages"."event_id" = 1
What I would like to be able to do is keep the association between the two, but add another column into the has_many equation so the SQL produced is something like:
SELECT "messages".* FROM "messages" WHERE "messages"."event_id" = 1 OR "messages"."type_id" = 4
Where both the Message and Event tables contain a type_id column.
Is this possible?