[Rails] Re: storing a file download in a temp file

2015-02-12 Thread JoeEd E.
I just wanted to add to this... I know I am 5 years too late, but I didn't want anyone else to be led astray. You should be able to pull anything you can download in your browser into your app using tempfile. I had to play with it for a while, but something like this worked: require "open-uri

[Rails] Re: how to add current time as default value

2013-07-01 Thread JoeEd E.
Okay, so it turns out that does not work either. Here is the actual syntax: execute "ALTER TABLE tablename CHANGE column_name column_name TIMESTAMP DEFAULT CURRENT_TIMESTAMP" You have to put the column name in twice as well as specify the datatype again. Also, you may be wondering why I am

[Rails] Re: how to add current time as default value

2013-07-01 Thread JoeEd E.
If Loganathan's answer does not work, try this: I had to use execute "ALTER TABLE system_settings ALTER created_time SET DEFAULT CURRENT_TIMESTAMP" (instead of NOW()) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby