Link table logic

How is this link represented in the rails model?

For example, can I say:

class User < ActiveRecord::Base

has_many :created_events

has_many :subscribed_events

has_many :events, :through => :created_events, :subscribed_events

or something to that effect? Also, how would work in this

case? The logic doesn’t seem quite correct!

Have I went about my database design in the wrong way?

As always, any help is greatly appreciated - I hope I have made myself


Untested, but fairly sure it will work:

Fetch the events for both relationships, then just add them:

def events

total = cr_ev + sb_ev



Best regards

Peter De Berdt