eriklane
2007-Mar-29 02:29 UTC
what to do when Rails generated select statements don''t work on custom types
Running FC6 with RoR 1.1.6
I''m using a custom type called ''uuid'' based on code
from this project.
http://gborg.postgresql.org/project/pguuid/projdisplay.php
Here''s a description of the ksessions table.
Table "public.ksessions"
Column | Type |
Modifiers
-------------+--------------------------
+------------------------------
title | text | not null
description | text | not null
public | boolean | not null default false
id | uuid | not null default uuid_time()
user_id | uuid | not null
Here''s the automatically generated SQL that returns 0 rows...
kapture_development=> select ksessions."id" from ksessions where
(ksessions."id" =
''67794c52-d0cd-11db-9a81-000d5679aec6'');
id
----
(0 rows)
Here''s my SQL that returns the exact row I''m looking for...
kapture_development=> select ksessions."id" from ksessions where
uuid_eq(ksessions."id",''67794c52-d0cd-11db-9a81-000d5679aec6'')
= ''1'';
id
--------------------------------------
67794c52-d0cd-11db-9a81-000d5679aec6
(1 row)
Where in the world do I fix this? I imagine I need to tell something
to
use this uuid_eq function instead of the ''='' operator for each
comparison/look up.
I''m guessing this involves messing with Rails or Active_RBAC somehow.
Any thoughts would be appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---