activerecord-jdbc trouble persisting Oracle DATE columns
--------------------------------------------------------
Key: JRUBY-5003
URL: http://jira.codehaus.org/browse/JRUBY-5003
Project: JRuby
Issue Type: Bug
Components: JRuby-extras
Reporter: Lenny Marks
Fix For: JRuby 1.4
Attachments: patch.txt
The Oracle adaptor treats DATE and TIMESTAMP fields the same in #quote
{code}
if value.acts_like?(:date) || value.acts_like?(:time)
quoted = "#{quoted_date(value)}"
end
...
def quoted_date(value)
%Q{TIMESTAMP'#{super}'}
end
{code}
If you set an object attribute to via string(e.g. text_field) then you will
wind up with an error because the string doesn't include a time component. I
believe DATE'2010-01-01' is what it should use.
ActiveRecord::StatementInvalid: ActiveRecord::JDBCError: ORA-01861: literal
does not match format string
: UPDATE DEFAULT_NUMBER SET datum = TIMESTAMP'2010-01-01' WHERE id = 1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email