Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
module ActiveRecord class Base class << self # fyi wordpress might screw up the double left def isolation_dirty() connection.dirty() end def isolation_clean() connection.clean() end def isolation_reallyclean() connection.reallyclean() end end end end module ActiveRecord module ConnectionAdapters module DatabaseStatements def dirty() raise NotImplementedError, "dirty is an abstract method" end def clean() raise NotImplementedError, "clean is an abstract method" end def reallyclean() raise NotImplementedError, "reallyclean is an abstract method" end end end end module ActiveRecord module ConnectionAdapters class MysqlAdapter def dirty() execute('SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED') end def clean() execute('SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ') end def reallyclean() execute('SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED') end end end end
This paste will be private.
From the Design Piracy series on my blog: