Displaying 1 result from an estimated 1 matches for "book_reviews".
2006 Jun 13
0
question about saving associations when using has_many :through
...s each month to be reviewed by other users. I have the following
relationships defined:
# the join model
book_review.rb
  belongs_to :user
  belongs_to :book
end
book.rb
  # each book is reviewed by many users. This allows us to get the BookReview
  # objects associated with this book
  has_many :book_reviews, :dependent => true
  # this :through association allows us to retrieve the users who have
  # been assigned to review this book
  has_many :reviewing_users, :through => :book_reviews, :source => :user
  # each book is submitted by a single user
  belongs_to :user
end
user.rb
  # each u...