This gives me strange error.
> Customer.where(:my_text_field => "05007062").first
> Customer Load (0.9ms) SELECT `customers`.* FROM `customers` WHERE `customers`.`my_text_field` = '05007062' LIMIT 1
ActiveRecord::StatementInvalid: Mysql2::Error: Invalid date: 2012-00-00 00:00:00: SELECT `customers`.* FROM `customers` WHERE `customers`.`my_text_field` = '05007062' LIMIT 1
...
Does anyone know why could that be? I don’t see any date in the query. Also, this happens only in production and not on development machine (both running linux).
I’m using Rails 3.1.0 and mysql2 0.3.10
Sounds like you may have some corrupted data in one of the records on your prod server. Do you have some other code that creates records in the db – including a date?