Displaying 1 result from an estimated 1 matches for "reviewer_category".
2006 Jun 29
4
Multiple belongs_to
...;'s say I have a catalog with hotels. Each hotel belongs to a
category (4-star, 5-star etc.) This is it''s official category.However,
there is also a category that users assign and a category that
"independent reviewers" assign. So I have this:
hotels {
id,
category_id,
reviewer_category,
user_category
}
categories {
id,
name
}
class Hotel < ActiveRecord::Base
belongs_to :hotel_class # this is fine and ok
# can I also something like this, however?
belongs_to :hotel_class,
:foreign_key => ''reviewer_category''
belongs_...