How to use Rails Migrations - Part I
I created a table with :created_at column as :null => false but I didn't define the default value so I was having problem with specifying the datetime in my test fixture.
I solved that problem by putting this in my test fixture:
created_at: <%= DateTime.now.strftime('%y-%m-%d %H:%M:%S') %>What I really should have done is created the column like this.
t.column :created_at, :datetime, :default => Time.now
No comments:
Post a Comment