database design - How would you model articles with references and citations in rails & ActiveRecord? -
There are several articles in an article that refer to it and many other articles can refer to it. Sometimes an article can refer to an article which also refers to it.
I want to do this:
class articles & lt ; ActiveRecord :: Base # is outlined in other articles I_many: Reference,: foreign_key = & gt; 'Referred_article_id' # The articles that refer to them include: Minders: Referrers, via = & gt; : Reference,: Foreign_key => 'Referenced_chart_id' # refers to the article in which it is_mind: referenced: = through & gt; : Reference,: Foreign_key => 'Referrer_id' end class reference & lt; ActiveRecord :: Base is_to: reference, class = & gt; Article is relative_to: specified_type, class = & gt; Article end
Comments
Post a Comment