ar_mysql_column_charset.rb 393 B

12345678910111213141516
  1. # Module#prepend support for Ruby 1.9
  2. require 'prepend' unless Module.method_defined?(:prepend)
  3. require 'active_support'
  4. ActiveSupport.on_load :active_record do
  5. class << ActiveRecord::Base
  6. def establish_connection(spec = nil)
  7. super.tap { |ret|
  8. if /mysql/i === connection.adapter_name
  9. require 'ar_mysql_column_charset/main'
  10. end
  11. }
  12. end
  13. end
  14. end