Created
February 12, 2013 15:34
-
-
Save ches/4770693 to your computer and use it in GitHub Desktop.
Date#step, a C method, does not like ActiveSupport::Duration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [2] pry(main)> Date.today.step(Date.tomorrow, 30.minutes).each { |time| puts time } | |
| 2013-02-12 | |
| TypeError: expected numeric | |
| from (pry):2:in `step' | |
| [3] pry(main)> show-source 30.minutes | |
| From: /Users/ches/.rvm/gems/ruby-1.9.3-p327@REDACTED/gems/activesupport-3.2.11/lib/active_support/core_ext/numeric/time.rb @ line 39: | |
| Owner: Numeric | |
| Visibility: public | |
| Number of lines: 3 | |
| def minutes | |
| ActiveSupport::Duration.new(self * 60, [[:seconds, self * 60]]) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment