← all posts

24 June 2008

I am so freaking awesome

  (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:

 if model.classify.is_a?(ActiveRecord::Base)
      <<-EVAL
      class #{model.classify}
        belongs_to :owner
      end
      EVAL
    end

too, but Rails didn’t like that.

— Ryan

Got a thought? Email me or find me on Mastodon.

Before this: Going Dark

After this: RailsCamp '08 (#1?)