-
Notifications
You must be signed in to change notification settings - Fork 385
Migrating from 1.2.x to 1.3.0
While the 1.3 release is meant to be compatible with 1.2 as much as possible (that's why it's not called 2.0 although it truly deserves it :) there are a few places where things might have changed. Usually this is for the better to fix old unwanted behaviour and/or ActiveRecord compatibility.
In ActiveRecord 3.1 methods such as exec_query
, exec_insert
and exec_update
where added, on AR-JDBC side support for them only meant delegating to what's been available already (mostly execute
). Thus in 1.2 exec_query
returns Array
results for all versions of ActiveRecord. Since 1.3 this is changed and for ActiveRecord >= 3.1 we return ActiveRecord::Result
objects - which behave quite similar (like enumerables) but one does need to be aware of the differences and not assume they're instances of Array
.
When setting non-string values for string/text columns the adapter does a bit of quoting to make sure the database does not vomit. Some of the quoting logic was a bit surprising and seemed redundant esp. since 1.3 supports prepared statements thus things got changed, namely :
- for
true
/false
valuesto_s
will be called, previously they were "quoted" into'0'
/'1'
values - for non-numeric, non-boolean, non-string and date-like objects (e.g. Hash-es) 1.2 does
to_yaml
while 1.3 simply callsto_s