What is the proper way of setting a test fixture for a date field in Oracle db? I''ve tried various ways like switching the year and no luck. My test fixture is: first: id: 1 department_id: 1 last_name: test1 first_name: first1 birth_date: 2004-01-26 00:00:00 country_of_origin: Canada job_title: Programmer created_on: 2004-01-26 00:00:00 created_by: testuser updated_on: testuser created_on: 2004-01-26 00:00:00 user_id: testuser I keep on getting ActiveRecord::StatementInvalid: OCIError: ORA-01841: (full) year must be between -4713 and +9999, and not be 0.... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
This should work: created_on: <%= Time.now.to_s(:db) %> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks Nicholas. The reason why it didnt work for me was because a typo. I have 2 created_on fields which conflicted. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---