From 5ae7a9d31d6222b265013ab450f9d30b88113e69 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 17 Jun 2010 14:10:51 -0700 Subject: when the timezone is nil, a TimeWithZone object should not be constructed. [#4881 state:resolved] Signed-off-by: Jeremy Kemper --- activesupport/lib/active_support/core_ext/date_time/zones.rb | 2 ++ activesupport/lib/active_support/core_ext/time/zones.rb | 2 ++ 2 files changed, 4 insertions(+) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/date_time/zones.rb b/activesupport/lib/active_support/core_ext/date_time/zones.rb index 98565e6750..6002d4ad2a 100644 --- a/activesupport/lib/active_support/core_ext/date_time/zones.rb +++ b/activesupport/lib/active_support/core_ext/date_time/zones.rb @@ -12,6 +12,8 @@ class DateTime # # DateTime.new(2000).in_time_zone('Alaska') # => Fri, 31 Dec 1999 15:00:00 AKST -09:00 def in_time_zone(zone = ::Time.zone) + return self unless zone + ActiveSupport::TimeWithZone.new(utc? ? self : getutc, ::Time.__send__(:get_zone, zone)) end end diff --git a/activesupport/lib/active_support/core_ext/time/zones.rb b/activesupport/lib/active_support/core_ext/time/zones.rb index adc9fe3824..a02402aa3f 100644 --- a/activesupport/lib/active_support/core_ext/time/zones.rb +++ b/activesupport/lib/active_support/core_ext/time/zones.rb @@ -73,6 +73,8 @@ class Time # # Time.utc(2000).in_time_zone('Alaska') # => Fri, 31 Dec 1999 15:00:00 AKST -09:00 def in_time_zone(zone = ::Time.zone) + return self unless zone + ActiveSupport::TimeWithZone.new(utc? ? self : getutc, ::Time.__send__(:get_zone, zone)) end end -- cgit v1.2.3 From a2b7fcb07ca47ca2285dee2afe97050532e94d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 19 Jun 2010 16:58:12 +0200 Subject: Change callbacks to automatically include DescendantsTracker and rename descendents to descendants. --- activesupport/lib/active_support/core_ext/class/subclasses.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/class/subclasses.rb b/activesupport/lib/active_support/core_ext/class/subclasses.rb index bbd8f5aef6..7d58a8b56a 100644 --- a/activesupport/lib/active_support/core_ext/class/subclasses.rb +++ b/activesupport/lib/active_support/core_ext/class/subclasses.rb @@ -11,9 +11,9 @@ class Class #:nodoc: # Rubinius if defined?(Class.__subclasses__) - def descendents + def descendants subclasses = [] - __subclasses__.each {|k| subclasses << k; subclasses.concat k.descendents } + __subclasses__.each {|k| subclasses << k; subclasses.concat k.descendants } subclasses end else @@ -21,7 +21,7 @@ class Class #:nodoc: begin ObjectSpace.each_object(Class.new) {} - def descendents + def descendants subclasses = [] ObjectSpace.each_object(class << self; self; end) do |k| subclasses << k unless k == self @@ -30,7 +30,7 @@ class Class #:nodoc: end # JRuby rescue StandardError - def descendents + def descendants subclasses = [] ObjectSpace.each_object(Class) do |k| subclasses << k if k < self @@ -48,7 +48,7 @@ class Class #:nodoc: def self.subclasses_of(*superclasses) #:nodoc: subclasses = [] superclasses.each do |klass| - subclasses.concat klass.descendents.select {|k| k.anonymous? || k.reachable?} + subclasses.concat klass.descendants.select {|k| k.anonymous? || k.reachable?} end subclasses end -- cgit v1.2.3 From 95a8f252c028c94b70cce4888bce42b7e9e30786 Mon Sep 17 00:00:00 2001 From: rohit Date: Wed, 16 Jun 2010 18:50:50 +0530 Subject: remove executable permission from files that don't need it. [#4802 state:resolved] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activesupport/lib/active_support/core_ext/object/to_param.rb | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 activesupport/lib/active_support/core_ext/object/to_param.rb (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/object/to_param.rb b/activesupport/lib/active_support/core_ext/object/to_param.rb old mode 100755 new mode 100644 -- cgit v1.2.3