Custom selected fields in ActiveRecord queries are returned as strings
----------------------------------------------------------------------
Key: JRUBY-6215
URL: https://jira.codehaus.org/browse/JRUBY-6215
Project: JRuby
Issue Type: Bug
Components: Miscellaneous
Environment: Rails 3.0.7, JRuby 1.6.4, MySQL
Reporter: Michal Ochman
Priority: Minor
Custom selected fields are returned as strings in JRuby, while in MRI are
converted to appropriate class.
Here is a very simple example. Having User model with created_at datetime field
MRI returns Time object:
{quote}
ruby-1.8.7-p330 :001 > User.select('created_at AS
custom_created_at').first.custom_created_at.class
=> Time
{quote}
while JRuby returns string:
{quote}
jruby-1.6.4 :029 > User.select('created_at AS
custom_created_at').first.custom_created_at.class
=> String
{quote}
The same problem is with other field types.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email