Howdy,
Names changed to protect the innocent...
I have a column, lets say ''complete'' on a table, lets say
''todos''.
I originally had that column as boolean (as its true/false)
I added an association to User... has_many :outstanding_todos which had
a :conditions => "complete = false".
When I run this up it doesn''t work, and the reson it doesn''t
work is
Sqlite (which I''m using for development) seems to set the value of a
false boolean column to ''f'' (which I''m fairly sure
mysql doesn''t do).
So I can change my :conditions, but then it''ll only work on sqlite,
right ?
Since it''s a string of raw sql, there doesn''t seem tobe a way
to pass it
through the DB adapter layer to use the correct syntax for the current
DB.
I''ve ended up making it an integer using 0 and 1 as that seems
portable.
Has anyone any other suggestions ?
Alan
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---