Created
August 14, 2011 18:11
-
-
Save eagsalazar/1145145 to your computer and use it in GitHub Desktop.
This file contains 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 | |
has_and_belongs_to_many :followers, :class_name => "User", :inverse_of => :followings | |
has_and_belongs_to_many :followings, :class_name => "User", :inverse_of => :followers | |
has_and_belongs_to_many :club_followings, :class_name => "Club", :inverse_of => :followers | |
end | |
class Club | |
has_and_belongs_to_many :followers, :class_name => "User", :inverse_of => :club_followings | |
end | |
# OR if polymorphic worked with habtm | |
class User | |
has_and_belongs_to_many :followers, :polymorphic => true, :inverse_of => :followings | |
has_and_belongs_to_many :followings, :polymorphic => true, :inverse_of => :followers | |
end | |
class Club | |
has_and_belongs_to_many :followers, :polymorphic => true, :inverse_of => :followings | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment