The Life of a Radar

I am so freaking awesome
24 Jun 2008
  (Dir.entries("#{RAILS_ROOT}/app/models") - [".","..",".svn"]).each do |model|
    has_many model.split(".").first.pluralize.to_sym, :foreign_key => "owner_id"
  end

I tried adding:

REXML could not parse this XML/HTML: 
<pre lang='rails'>
 if model.classify.is_a?(ActiveRecord::Base)
      <<-EVAL
      class #{model.classify}
        belongs_to :owner
      end
      EVAL
    end
</pre>

too, but Rails didn’t like that.

blog comments powered by Disqus