2:30am wired on redbull

— June 18, 2006 at 10:55 PDT


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

1 commentrailsday, sightings

Comments
  1. John B2006-06-18 23:03:19

    That's funny. :)

Sorry, comments for this article are closed.