Skip to content

Commit e00a5b9

Browse files
committed
Added monkeypatch to fix RubyGem 1.3.2's broken Time::today.
1 parent b063f24 commit e00a5b9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

config/initializers/libraries.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
require 'lib/ext/active_support_cache_object'
1010
require 'lib/ext/object_logit'
1111
require 'lib/ext/active_record_quoting_fix'
12-
12+
require 'lib/ext/time_today'

lib/ext/time_today.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Time.today was eliminated in RubyGems 1.3.2. This monkey patch puts it back.
2+
# https://rubyforge.org/tracker/index.php?func=detail&aid=25564&group_id=126&atid=575
3+
4+
class Time
5+
def self.today
6+
return Date.today.to_time
7+
end
8+
end

0 commit comments

Comments
 (0)