Browse files

OoO fix and a method call savings for Time#from_mongo

  • Loading branch information...
1 parent c4657ad commit 94e98252de4180fe13ba227d93c9ad1821af8293 @cheald cheald committed Sep 28, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/mongo_mapper/extensions/time.rb
View
4 lib/mongo_mapper/extensions/time.rb
@@ -13,8 +13,8 @@ def to_mongo(value)
end
def from_mongo(value)
- if ::Time.try(:zone).present? && value.present?
- value.in_time_zone(::Time.zone)
+ if value and zone = ::Time.try(:zone)
+ value.in_time_zone(zone)
else
value
end

0 comments on commit 94e9825

Please sign in to comment.