Romain Maz BILLOIR
unread,Sep 27, 2011, 4:30:11 PM9/27/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby on Rails: Talk
(Frenchy, sorry)
Hi everyone, i'm working on a web browser based game. I need to use
some postgresql special type such as point, path and line.
ActiveRecord caused me some troubles to migrate but now it's ok for
creating/migrating the database and querying the tables. BUT! Every
special type select are returned me as String...
To begin i tried to use a simple position "point" column. I tried some
few things like:
@first_character = Character.select("position[0] as x, position[1] as
y").first
@first_character.x returns me the good x value
@first_character.y return me a nil value...
OR:
@first_character = Character.select("position[1] as y, position[0] as
x").first
@first_character.y returns me the good y value
@first_character.x return me a nil value...
Why?!!
I know i should use an adapter, but: i really don't need PostGIS on my
database, i just use simples types and functions proposed by
postgresql native.
Regards.