I''m having a problem using the datetime_select helper for data held in an Oracle (10g) database. The data is stored in Oracle as DATE and the helper works fine if there is a non-zero time component of the date. Unfortunately if there isn''t a time component (ie. the time value is midnight - 00:00:00) then it breaks with the following error message: - NoMethodError in Weeks#edit ... private method `min'' called for #<Date: 4908799/2,0,2299161> From what I can gather it looks like the code is seeing the zero time value and therefore casting the data into a DATE type rather than a DATETIME. Any assistance would be appreciated. John --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> I''m having a problem using the datetime_select helper for data held in > an Oracle (10g) database. > > The data is stored in Oracle as DATE and the helper works fine if > there is a non-zero time component of the date. Unfortunately if there > isn''t a time component (ie. the time value is midnight - 00:00:00) > then it breaks with the following error message: - > > NoMethodError in Weeks#edit > ... > private method `min'' called for #<Date: 4908799/2,0,2299161> > > From what I can gather it looks like the code is seeing the zero time > value and therefore casting the data into a DATE type rather than a > DATETIME. > > Any assistance would be appreciated.The oracle adapter is maintained by Michael Schoen, so he''s probably the best person to ask about why it''s doing that. It would appear to be deliberate though. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Hi John, This datatime_select issue has been fixed in the Rails svn trunk, but Rails 1.2.5 or before doesn''t incorporate this change. Check the <a href="http://dev.rubyonrails.org/ticket/7718">Ticket[7718] Resolve Oracle Datetime issue</a> for details. You can install the latest Oracle adapter via gem: gem install activerecord-oracle-adapter --source http://gems.rubyonrails.org or check it out from svn: svn co http://svn.rubyonrails.org/rails/adapters/oracle/lib/active_record/connection_adapters/ since Rails 2.0 will not ship with Oracle adapter. -- Cheers, Jesse On Nov 19, 9:58 pm, John Howard <john.howard...@gmail.com> wrote:> I''m having a problem using the datetime_select helper for data held in > an Oracle (10g) database. > > The data is stored in Oracle as DATE and the helper works fine if > there is a non-zero time component of the date. Unfortunately if there > isn''t a time component (ie. the time value is midnight - 00:00:00) > then it breaks with the following error message: - > > NoMethodError in Weeks#edit > ... > private method `min'' called for #<Date: 4908799/2,0,2299161> > > From what I can gather it looks like the code is seeing the zero time > value and therefore casting the data into a DATE type rather than a > DATETIME. > > Any assistance would be appreciated. > > John--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Hi John, This datatime_select issue has been fixed in the Rails svn trunk, but Rails 1.2.5 or before doesn''t incorporate this change. Check the Ticket[7718] Resolve Oracle Datetime issue <http://dev.rubyonrails.org/ticket/7718>for details. You can install the latest Oracle adapter via gem: gem install activerecord-oracle-adapter --source http://gems.rubyonrails.org or check it out from svn: svn co http://svn.rubyonrails.org/rails/adapters/oracle/lib/active_record/connection_adapters/ since Rails 2.0 will not ship with Oracle adapter. -- Cheers, Jesse --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
That''s sorted it - thanks very much!!! On Nov 22, 8:42 am, "胡辉" <yiz...@gmail.com> wrote:> Hi John, > > This datatime_select issue has been fixed in theRailssvn trunk, butRails > 1.2.5 or before doesn''t incorporate this change. Check the Ticket[7718] > ResolveOracleDatetimeissue <http://dev.rubyonrails.org/ticket/7718>for > details. You can install the latestOracleadapter via gem: > gem install activerecord-oracle-adapter --sourcehttp://gems.rubyonrails.org > > or check it out from svn: > svn cohttp://svn.rubyonrails.org/rails/adapters/oracle/lib/active_record/co... > > sinceRails2.0 will not ship withOracleadapter. > > -- > Cheers, > Jesse--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---