
[Bug] Custom queries return wrong types
Reported by Jeffrey Gelens | December 27th, 2007 @ 09:51 AM
This only seems to happen using mysql and sqlite3
Using mysql I execute the following:
(Service.find_by_sql("select * from services"))[0]
=> #<struct #<Class:0xb7433368> id="1", server_id="1", name="Server1", status="0", monitor="1", collected="1198550696", kind="5">
As you can see the results are all a string.
When I execute the same query in postgresql:
(Service.find_by_sql("select * from services"))[0]
=> #<struct #<Class:0xb7b02aa4> id=1790, name="Server1", status=0, monitor=true, collected=1198551630, kind=5, server_id=8>
All fields have the right type. I think this has something to do with dataobjects?
Comments and changes to this ticket
-
Sam Smoot December 27th, 2007 @ 09:51 AM
- State changed from new to invalid
Duplicate. Couldn't figure out how to delete dupes marked as spam, so approved 'em instead to mark as invalid.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
- Nobody is watching this ticket.