Displaying 1 result from an estimated 1 matches for "reviewing_users".
2006 Jun 13
0
question about saving associations when using has_many :through
...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 user must submit a number of books each month
has_many :submitted_books, :class_name => "Book", :dependent => :delete_all
# each user has a l...