Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'activesupport'
- t = Time.now
- begin
- candidate = t.advance(:years => 10)
- puts candidate < Time.now
- rescue ArgumentError => exception
- case exception.to_s
- when "comparison of DateTime with Time failed"
- puts candidate < DateTime.now
- end
- end
Add Comment
Please, Sign In to add comment