From: Eric Hodel Date: 2005-11-18T04:13:21+09:00 Subject: Re: Time.yesterday ? :) On Nov 17, 2005, at 10:57 AM, Gene Tani wrote: > Gregory Brown wrote: >> You don't need the intermediate variable >> >> class Time >> def self.yesterday >> now - 86400 >> end >> end >> >> Time.yesterday works just fine :) > > It's in Active Support: > > http://as.rubyonrails.com/ No, Time.yesterday is not in active_support, Time#yesterday is. Also, active_support emits far, far, far too many warnings. I could *maybe* deal with 1 or two warnings, but not 169: $ cat yesterday.rb #!/usr/local/bin/ruby -w require 'rubygems' require 'active_support' p Time.yesterday $ ruby yesterday.rb /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/ active_support/class_inheritable_attributes.rb:116: warning: discarding old inherited /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/ active_support/inflections.rb:2: warning: ambiguous first argument; put parentheses or even spaces [snip 167 lines of warnings] yesterday.rb:6: undefined method `yesterday' for Time:Class (NoMethodError) -- Eric Hodel - drbrain@segment7.net - http://segment7.net FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04