22
33require 'bigdecimal'
44require 'active_record/connection_adapters/abstract/schema_definitions'
5- require 'arjdbc/mysql/column'
6- require 'arjdbc/mysql/bulk_change_table'
7- require 'arjdbc/mysql/explain_support'
8- require 'arjdbc/mysql/schema_creation' # AR 4.x
95
106module ArJdbc
117 module MySQL
8+
9+ # @private
10+ AR42 = ActiveRecord ::VERSION ::STRING >= '4.2'
11+
12+ require 'arjdbc/mysql/column'
13+ require 'arjdbc/mysql/bulk_change_table'
14+ require 'arjdbc/mysql/explain_support'
15+ require 'arjdbc/mysql/schema_creation' # AR 4.x
16+
1217 include BulkChangeTable if const_defined? :BulkChangeTable
1318
1419 # @see ActiveRecord::ConnectionAdapters::JdbcAdapter#jdbc_connection_class
@@ -145,7 +150,7 @@ def case_sensitive_modifier(node)
145150 def case_sensitive_modifier ( node , table_attribute )
146151 node = Arel ::Nodes . build_quoted node , table_attribute
147152 Arel ::Nodes ::Bin . new ( node )
148- end if ActiveRecord :: VERSION :: STRING > '4.2'
153+ end if AR42
149154
150155 def limited_update_conditions ( where_sql , quoted_table_name , quoted_primary_key )
151156 where_sql
@@ -162,9 +167,14 @@ def initialize_schema_migrations_table
162167 # HELPER METHODS ===========================================
163168
164169 # @private Only for Rails core compatibility.
165- def new_column ( field , default , type , null , collation , extra = '' )
170+ def new_column ( field , default , type , null , collation , extra = "" )
166171 Column . new ( field , default , type , null , collation , strict_mode? , extra )
167- end
172+ end unless AR42
173+
174+ # @private Only for Rails core compatibility.
175+ def new_column ( field , default , cast_type , sql_type = nil , null = true , collation = "" , extra = "" )
176+ Column . new ( field , default , cast_type , sql_type , null , collation , strict_mode? , extra )
177+ end if AR42
168178
169179 # @private Only for Rails core compatibility.
170180 def error_number ( exception )
0 commit comments