projects | github | twitter | rss | contact

stop the world, i want to get off

posted to writings on may 7th, 2008 with tags activerecord, FUCKFUCKFUCK, rails, and ruby

activerecord, your default and static :force => true setting has fucked me over for the last time.

module ActiveRecord
  class SchemaDumper
  private
    alias :original_table :table
    def table(table, stream)
      (d = self.send(:original_table, table, StringIO.new)).rewind
      stream.print d.read.gsub(/, :force => true/, "")
    end
  end
end

i don't understand why anyone would make a default option eat all of your database tables.

Comments? Contact me via Twitter or e-mail.