iDevGames Forums
Ruby on Rails setting Time to NULL - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Programming Languages & Scripting (/forum-8.html)
+--- Thread: Ruby on Rails setting Time to NULL (/thread-2929.html)



Ruby on Rails setting Time to NULL - BeyondCloister - Nov 21, 2007 06:25 AM

I've been searching around the documentation and the internet but cannot work out how to do the simple task of setting a Time variable to null.

Can anyone tell me the secret?


Ruby on Rails setting Time to NULL - AndyKorth - Nov 21, 2007 06:56 AM

Ruby uses nil instead of null.

Code:
kortham@Rivest ~$ irb
>> my_time = nil
=> nil



Ruby on Rails setting Time to NULL - BeyondCloister - Nov 21, 2007 07:14 AM

Sorry my mistake.

I did know about the nil but that was throwing up errors when I changed to the code to use it. However closer inspection reveals it is an error occuring unrelated to the code change.


Ruby on Rails setting Time to NULL - AndyKorth - Nov 21, 2007 09:56 AM

Ah, no problem, it happens all the time - to me at least Grin