aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/time_with_zone.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-04-20 18:31:22 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-04-20 18:31:40 -0700
commit685a53a360d0d8fc4a9f3b49f900621c940a71f2 (patch)
treefa6b38f75a873a21c3e380f1acbab3d019293363 /activesupport/lib/active_support/time_with_zone.rb
parentdb05c73fb6e2294c576ef9889c70940891682c32 (diff)
parent164a94d0bc8c9124ab820506e5ad79496395c026 (diff)
downloadrails-685a53a360d0d8fc4a9f3b49f900621c940a71f2.tar.gz
rails-685a53a360d0d8fc4a9f3b49f900621c940a71f2.tar.bz2
rails-685a53a360d0d8fc4a9f3b49f900621c940a71f2.zip
Merge branch 'master' into cherry
Conflicts: activesupport/CHANGELOG activesupport/lib/active_support/core_ext/class/delegating_attributes.rb activesupport/lib/active_support/core_ext/hash/conversions.rb activesupport/lib/active_support/core_ext/module/attribute_accessors.rb activesupport/lib/active_support/core_ext/string/multibyte.rb activesupport/lib/active_support/core_ext/time/calculations.rb activesupport/lib/active_support/deprecation.rb
Diffstat (limited to 'activesupport/lib/active_support/time_with_zone.rb')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index 9dcf75ff96..69abb80721 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -36,6 +36,11 @@ module ActiveSupport
# t.is_a?(Time) # => true
# t.is_a?(ActiveSupport::TimeWithZone) # => true
class TimeWithZone
+
+ def self.name
+ 'Time' # Report class name as 'Time' to thwart type checking
+ end
+
include Comparable
attr_reader :time_zone
@@ -244,10 +249,10 @@ module ActiveSupport
end
%w(year mon month day mday wday yday hour min sec to_date).each do |method_name|
- class_eval <<-EOV
- def #{method_name} # def year
- time.#{method_name} # time.year
- end # end
+ class_eval <<-EOV, __FILE__, __LINE__ + 1
+ def #{method_name} # def month
+ time.#{method_name} # time.month
+ end # end
EOV
end