Created
July 12, 2011 16:15
-
-
Save stephenprater/1078326 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
has_many :user_favorite_markets | |
:class_name => "UserFavoriteMarket", | |
:foreign_key => :user_id | |
has_many :favorite_markets, | |
:class_name => "FarmersMarket", | |
:through => :user_favorite_markets | |
:source => :market | |
# I think this is the general idea. You have to have an association for the join table as well. | |
has_many :favorite_markets, | |
:through => :user_favorite_markets | |
:select => 'markets.name, user_favorite_markets.*', | |
:source => :market |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment