Forum: Ruby on Rails habtm and belongs_to one table

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Steve R. (Guest)
on 2006-04-18 23:24
(Received via mailing list)
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
--
View this message in context:
http://www.nabble.com/habtm-and-belongs_to-one-tab...
Sent from the RubyOnRails Users forum at Nabble.com.
Steve R. (Guest)
on 2006-04-18 23:24
(Received via mailing list)
Sorry. Poor form to reply to my own post... I don't think it's a habtm
thing
as you see in my previous post.

thanks
--
View this message in context:
http://www.nabble.com/habtm-and-belongs_to-one-tab...
Sent from the RubyOnRails Users forum at Nabble.com.
This topic is locked and can not be replied to.