Module: RedhillonrailsCore::ActiveRecord::ConnectionAdapters::MysqlAdapterFixes

Included in:
MysqlAdapter
Defined in:
lib/redhillonrails_core/active_record/connection_adapters/mysql_adapter_fixes.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Starting from mysql2 0.2.7 Mysql2IndexDefinition is used. In 0.2 line it is inculuded in gem itself. Starting from version 0.3 it has gone to active_record mysql adapter We have to additionally monkey patch it.



10
11
12
13
14
15
16
17
# File 'lib/redhillonrails_core/active_record/connection_adapters/mysql_adapter_fixes.rb', line 10

def self.included(base)
  super
  if defined?(::ActiveRecord::ConnectionAdapters::Mysql2IndexDefinition)
    ::ActiveRecord::ConnectionAdapters::Mysql2IndexDefinition.class_eval do
      include ::RedhillonrailsCore::ActiveRecord::ConnectionAdapters::IndexDefinition
    end
  end
end