Skip to content

Instantly share code, notes, and snippets.

@jeffrwells
Created October 30, 2013 07:13
Show Gist options
  • Save jeffrwells/7228297 to your computer and use it in GitHub Desktop.
Save jeffrwells/7228297 to your computer and use it in GitHub Desktop.
User model with two event models.
class User < ActiveRecord::Base
has_many :github_events
has_many :twitter_events
def events
#help: github + twitter
end
end
class GithubEvent < ActiveRecord::Base
belongs_to :user
end
class TwitterEvent < ActiveRecord::Base
belongs_to :user
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment