Skip to content

Commit

Permalink
Duck typing here
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Nov 11, 2010
1 parent 5dc7f34 commit 2651a87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/time_with_zone.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def in_time_zone(new_zone = ::Time.zone)


# Returns a <tt>Time.local()</tt> instance of the simultaneous time in your system's <tt>ENV['TZ']</tt> zone # Returns a <tt>Time.local()</tt> instance of the simultaneous time in your system's <tt>ENV['TZ']</tt> zone
def localtime def localtime
utc.is_a?(DateTime) ? utc.to_time.getlocal : utc.getlocal utc.respond_to?(:getlocal) ? utc.getlocal : utc.to_time.getlocal
end end
alias_method :getlocal, :localtime alias_method :getlocal, :localtime


Expand Down

0 comments on commit 2651a87

Please sign in to comment.