Skip to content

Instantly share code, notes, and snippets.

@darkslategrey
Created May 22, 2014 15:49
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 darkslategrey/c59622b782dc84954407 to your computer and use it in GitHub Desktop.
Save darkslategrey/c59622b782dc84954407 to your computer and use it in GitHub Desktop.
class Service < ActiveRecord::Base
has_many :user_services
has_many :users, through: :user_services
end
class UserService < ActiveRecord::Base
belongs_to :service
belongs_to :user
end
class User < ActiveRecord::Base
has_many :user_services
has_many :services, through: :user_services
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment