Skip to content
This repository
Browse code

- Updated tzinfo to use Rational() instead of Rational.new! due to "p…

…rivate method new!" in Ruby 1.9 - Added ^object_id$ as ignore pattern to fixing "redefining object_id" issue in Ruby 1.9

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit a34cc42a2c29928bcdc75b700343f978a9524e58 1 parent 762295e
authored May 19, 2008 jeremy committed May 19, 2008
2  activerecord/lib/active_record/associations/association_proxy.rb
@@ -49,7 +49,7 @@ class AssociationProxy #:nodoc:
49 49
       alias_method :proxy_respond_to?, :respond_to?
50 50
       alias_method :proxy_extend, :extend
51 51
       delegate :to_param, :to => :proxy_target
52  
-      instance_methods.each { |m| undef_method m unless m =~ /(^__|^nil\?$|^send$|proxy_)/ }
  52
+      instance_methods.each { |m| undef_method m unless m =~ /(^__|^nil\?$|^send$|proxy_|^object_id$)/ }
53 53
 
54 54
       def initialize(owner, reflection)
55 55
         @owner, @reflection = owner, reflection
4  activerecord/lib/active_record/named_scope.rb
@@ -102,7 +102,7 @@ def named_scope(name, options = {}, &block)
102 102
     
103 103
     class Scope
104 104
       attr_reader :proxy_scope, :proxy_options
105  
-      [].methods.each { |m| delegate m, :to => :proxy_found unless m =~ /(^__|^nil\?|^send|class|extend|find|count|sum|average|maximum|minimum|paginate)/ }
  105
+      [].methods.each { |m| delegate m, :to => :proxy_found unless m =~ /(^__|^nil\?|^send|^object_id$|class|extend|find|count|sum|average|maximum|minimum|paginate)/ }
106 106
       delegate :scopes, :with_scope, :to => :proxy_scope
107 107
 
108 108
       def initialize(proxy_scope, options, &block)
@@ -136,4 +136,4 @@ def load_found
136 136
       end
137 137
     end
138 138
   end
139  
-end
  139
+end
114  activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/offset_rationals.rb
@@ -27,63 +27,63 @@ module TZInfo
27 27
   # -14 and +14 hours to avoid having to call gcd at runtime.  
28 28
   module OffsetRationals #:nodoc:
29 29
     @@rational_cache = {
30  
-      -50400 => Rational.new!(-7,12), 
31  
-      -48600 => Rational.new!(-9,16),
32  
-      -46800 => Rational.new!(-13,24),
33  
-      -45000 => Rational.new!(-25,48),
34  
-      -43200 => Rational.new!(-1,2),
35  
-      -41400 => Rational.new!(-23,48),
36  
-      -39600 => Rational.new!(-11,24),
37  
-      -37800 => Rational.new!(-7,16),
38  
-      -36000 => Rational.new!(-5,12),
39  
-      -34200 => Rational.new!(-19,48),
40  
-      -32400 => Rational.new!(-3,8),
41  
-      -30600 => Rational.new!(-17,48),
42  
-      -28800 => Rational.new!(-1,3),
43  
-      -27000 => Rational.new!(-5,16),
44  
-      -25200 => Rational.new!(-7,24),
45  
-      -23400 => Rational.new!(-13,48),
46  
-      -21600 => Rational.new!(-1,4),
47  
-      -19800 => Rational.new!(-11,48),
48  
-      -18000 => Rational.new!(-5,24),
49  
-      -16200 => Rational.new!(-3,16),
50  
-      -14400 => Rational.new!(-1,6),
51  
-      -12600 => Rational.new!(-7,48),
52  
-      -10800 => Rational.new!(-1,8),
53  
-       -9000 => Rational.new!(-5,48),
54  
-       -7200 => Rational.new!(-1,12),
55  
-       -5400 => Rational.new!(-1,16),
56  
-       -3600 => Rational.new!(-1,24),
57  
-       -1800 => Rational.new!(-1,48),
58  
-           0 => Rational.new!(0,1),
59  
-        1800 => Rational.new!(1,48),
60  
-        3600 => Rational.new!(1,24),
61  
-        5400 => Rational.new!(1,16),
62  
-        7200 => Rational.new!(1,12),
63  
-        9000 => Rational.new!(5,48),
64  
-       10800 => Rational.new!(1,8),
65  
-       12600 => Rational.new!(7,48),
66  
-       14400 => Rational.new!(1,6),
67  
-       16200 => Rational.new!(3,16),
68  
-       18000 => Rational.new!(5,24),
69  
-       19800 => Rational.new!(11,48),
70  
-       21600 => Rational.new!(1,4),
71  
-       23400 => Rational.new!(13,48),
72  
-       25200 => Rational.new!(7,24),
73  
-       27000 => Rational.new!(5,16),
74  
-       28800 => Rational.new!(1,3),
75  
-       30600 => Rational.new!(17,48),
76  
-       32400 => Rational.new!(3,8),
77  
-       34200 => Rational.new!(19,48),
78  
-       36000 => Rational.new!(5,12),
79  
-       37800 => Rational.new!(7,16),
80  
-       39600 => Rational.new!(11,24),
81  
-       41400 => Rational.new!(23,48),
82  
-       43200 => Rational.new!(1,2),
83  
-       45000 => Rational.new!(25,48),
84  
-       46800 => Rational.new!(13,24),  
85  
-       48600 => Rational.new!(9,16),            
86  
-       50400 => Rational.new!(7,12)}
  30
+      -50400 => Rational(-7,12),
  31
+      -48600 => Rational(-9,16),
  32
+      -46800 => Rational(-13,24),
  33
+      -45000 => Rational(-25,48),
  34
+      -43200 => Rational(-1,2),
  35
+      -41400 => Rational(-23,48),
  36
+      -39600 => Rational(-11,24),
  37
+      -37800 => Rational(-7,16),
  38
+      -36000 => Rational(-5,12),
  39
+      -34200 => Rational(-19,48),
  40
+      -32400 => Rational(-3,8),
  41
+      -30600 => Rational(-17,48),
  42
+      -28800 => Rational(-1,3),
  43
+      -27000 => Rational(-5,16),
  44
+      -25200 => Rational(-7,24),
  45
+      -23400 => Rational(-13,48),
  46
+      -21600 => Rational(-1,4),
  47
+      -19800 => Rational(-11,48),
  48
+      -18000 => Rational(-5,24),
  49
+      -16200 => Rational(-3,16),
  50
+      -14400 => Rational(-1,6),
  51
+      -12600 => Rational(-7,48),
  52
+      -10800 => Rational(-1,8),
  53
+       -9000 => Rational(-5,48),
  54
+       -7200 => Rational(-1,12),
  55
+       -5400 => Rational(-1,16),
  56
+       -3600 => Rational(-1,24),
  57
+       -1800 => Rational(-1,48),
  58
+           0 => Rational(0,1),
  59
+        1800 => Rational(1,48),
  60
+        3600 => Rational(1,24),
  61
+        5400 => Rational(1,16),
  62
+        7200 => Rational(1,12),
  63
+        9000 => Rational(5,48),
  64
+       10800 => Rational(1,8),
  65
+       12600 => Rational(7,48),
  66
+       14400 => Rational(1,6),
  67
+       16200 => Rational(3,16),
  68
+       18000 => Rational(5,24),
  69
+       19800 => Rational(11,48),
  70
+       21600 => Rational(1,4),
  71
+       23400 => Rational(13,48),
  72
+       25200 => Rational(7,24),
  73
+       27000 => Rational(5,16),
  74
+       28800 => Rational(1,3),
  75
+       30600 => Rational(17,48),
  76
+       32400 => Rational(3,8),
  77
+       34200 => Rational(19,48),
  78
+       36000 => Rational(5,12),
  79
+       37800 => Rational(7,16),
  80
+       39600 => Rational(11,24),
  81
+       41400 => Rational(23,48),
  82
+       43200 => Rational(1,2),
  83
+       45000 => Rational(25,48),
  84
+       46800 => Rational(13,24),
  85
+       48600 => Rational(9,16),
  86
+       50400 => Rational(7,12)}
87 87
     
88 88
     # Returns a Rational expressing the fraction of a day that offset in 
89 89
     # seconds represents (i.e. equivalent to Rational(offset, 86400)). 

0 notes on commit a34cc42

Please sign in to comment.
Something went wrong with that request. Please try again.