I need to extend the Date class. Or more accurately, the
ActiveSupport::CoreExtensions::Calculations module. Everything works
fine when I include the new method in that module itself. But when I try to
move the extension out of that module and into my application space (e.g.,
in the lib directory), I get a method not found error. I'm sure I'm missing
something basic, but could sure use some help identifying what that thing
is. I've tried various locations thinking that maybe I was just putting it
in the wrong place, but nothing's worked. Any help's much appreciated!
----------- calculations.rb module extension ---------------
module ActiveSupport #:nodoc:
module CoreExtensions #:nodoc:
module Date #:nodoc:
# Enables the use of time calculations within Time itself
if self.strftime('%a') == 'Fri'
return self.advance(:days => 2)
elsif self.strftime('%a') == 'Sat'
return self.advance(:days => 1)