Skip to content

Instantly share code, notes, and snippets.

@rsl
Created August 27, 2014 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsl/7de7f319a31cf196c748 to your computer and use it in GitHub Desktop.
Save rsl/7de7f319a31cf196c748 to your computer and use it in GitHub Desktop.
whoa
class User < ActiveRecord::Base
# Owned events
has_many :events, dependent: :nullify
has_many :event_memberships, dependent: :nullify
has_many :member_events, through: :event_memberships, source: :user
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment