I have to admit, this makes for some beautiful irony
65: spawn/split actions
Author.rb:
def name
name || @user.name
end
69: POLYMORPHIC SELF-REFERENTIAL HAS_MANY :THROUGH... TAKE THAT, SUCKAS!
Article.rb:
has_many :wiki_refs_as_source, :as => :source,
:foreign_key => 'source_id', :class_name => 'WikiRef',
:dependent => :destroy
has_many :targets, :through => :wiki_refs_as_source
has_many :wiki_refs_as_target, :foreign_key => 'target_id', :class_name => 'WikiRef',
:dependent => :destroy
has_many :source_articles, :through => :wiki_refs_as_target,
:conditions => "wiki_refs.source_type = 'Article'"
has_many :source_comments, :through => :wiki_refs_as_target,
:conditions => "wiki_refs.source_type = 'Comment'"
70: oops
Author.rb:
def name
@name || @user.name
end
That's funny. :)