Hi Cory, Read does have an explicit relationship to an Article as you can
see in the model. Please see the code snippet below:
class Article < ActiveRecord::Base
has_many :readings
end
class User < ActiveRecord::Base
has_many :readings
end
class Reading < ActiveRecord::Base
belongs_to :article
belongs_to :user
end
What are you trying to accomplish within your project?
-Conrad
On 10/5/06, Cory Wilkerson
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
>
> Ok...so I posted yesterday regarding relationships between:
>
> Users
> Products
> Purchases
>
> Thanks all for the answers; very informative. What I''m really
running
> up against is more an issue like Dave Thomas describes wrt
> articles/users/reads in ADWR. So, using that as the OM:
>
> Articles
> Users
> Reads
>
> Dave uses the has_and_belongs_to_many idiom to join Users and Articles
> via Reads without ever promoting "Reads" to a proper model. My
> questions is: is this still the current train of thought in the rails
> community (meaning just using habtm).
>
> Dave *does* suggest that the users_articles table is just a mask for
> what should be a model, so assuming that I *do* promote Reads to a
> model...let''s talk relationships:
>
> - A User has many reads
> - A Read belongs to a user
> - An Article technically doesn''t belong to anything
> - Does a Read have an explicit relationship to an Article? What is that
> relationship? Why am I confounded re: something that seems so trivial.
>
> Arrrgh! Help!
>
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---