On Dec 27, 2005, at 12:57 PM, James Howison wrote:
Thinking in rails terms (or rather ActiveRecord terms), how about this:
has_many :creators
where Creator < Agent;
But creatorship is not intrinsic to an object; it's a relation. I
could be a creator of one resource, and a translator for another.
Rails doesn't currently handle this well out of the box. The Rails
coders are, however, working on better support for these sorts of
relations, where -- once they release 1.1 -- you'd end up with
something like this (this is quoted directly from an email I got from
David H. earlier today):
class Contribution
belongs_to :agent
belongs_to :reference
acts_as_list :scope => :reference
end
class Agent
has_many :contributions
has_many :references, :through => :contributions
end
class Reference
has_many :contributions
has_many :references, :through => :contributions
end
How's that?
The contributions table, in this case, would also keep track of type of
contribution (editor, author, etc.) and position in the sequence. I'll
have to think more about whether primary contributors need to be
handled completely separately from secondary (like translators).
Bruce
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]