Created
March 28, 2011 15:26
-
-
Save thbishop/890654 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Group < ActiveRecord::Base | |
| has_many :group_memberships, :dependent => :destroy | |
| has_many :members, :through => :group_memberships, :source => :user | |
| end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class User < ActiveRecord::Base | |
| has_many :group_memberships, :dependent => :destroy | |
| has_many :groups, :through => :group_memberships | |
| # Include default devise modules. Others available are: | |
| # :token_authenticatable, :confirmable, :lockable and :timeoutable | |
| devise :invitable, :database_authenticatable, :registerable, | |
| :recoverable, :rememberable, :validatable | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment