Displaying 1 result from an estimated 1 matches for "a3974972".
Did you mean:
397497
2006 Apr 18
1
habtm and belongs_to one table
I have the following:
Posts belong to a User
Posts may be Monitored by many Users
How do you characterize this?
class Post < ActiveRecord::Base
belongs_to :user
has_many :monitors
class Monitor < ActiveRecord::Base
has_many :posts, :as => user
class User < ActiveRecord::Base
has_many :posts # when a user *does* a post
belongs_to :monitor, :polymorphic => true
--