Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Paper
- include DataMapper::Resource
- property :id, Serial
- property :name, String
- has n, :authors, :class_name => "Person", :through => Resource
- has n, :citations
- has n, :papers, :through => :citations
- end
- class Citation
- include DataMapper::Resource
- belongs_to :citing_paper, :class_name => "Paper", :child_key => [:cited_paper_id]
- belongs_to :cited_paper, :class_name => "Paper", :child_key => [:cited_paper_id]
- end
Add Comment
Please, Sign In to add comment