2.0/RC2: AR not happy with Time objects?

Hi --

Please see http://pastie.caboo.se/124252. It shows that if I do this:

   Auction.new(:start_date => Time.now)

twice in a row, it blows up the first time but works the second time.

I haven't found any bug reports or discussion on this yet, so if no
one knows of any I'll file something.

David

Hi --

Please see http://pastie.caboo.se/124252. It shows that if I do this:

  Auction.new(:start_date => Time.now)

twice in a row, it blows up the first time but works the second time.

That's just because you're using a column called 'increment' which is defined on AR::Base, because it's likely to misbehave we're warning you in advance

lib/active_record/base.rb: def increment(attribute)
lib/active_record/base.rb: self[attribute] ||= 0
lib/active_record/base.rb: self[attribute] += 1
lib/active_record/base.rb: self
lib/active_record/base.rb: end

It only happens the first time because those methods are only generated once.

I haven't found any bug reports or discussion on this yet, so if no
one knows of any I'll file something.

David

--
Upcoming training by David A. Black/Ruby Power and Light, LLC:
   * Intro to Rails, London, UK, December 3-6 (by Skills Matter)
See http://www.rubypal.com for details and 2008 announcements!

--~--~---------~--~----~------------~-------~--~----~
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/rubyonrai

Michael Koziarski
michael@koziarski.com

Hi --