Skip to content

Instantly share code, notes, and snippets.

@smathy
Created April 14, 2016 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smathy/192392ec134a86e408760b1303b0e948 to your computer and use it in GitHub Desktop.
Save smathy/192392ec134a86e408760b1303b0e948 to your computer and use it in GitHub Desktop.
[7] pry(main)> rand(1.year)
NoMethodError: undefined method `begin' for 31557600.0:Float
from /Users/jk/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.1.6/lib/active_support/duration.rb:115:in `method_missing'
[8] pry(main)> 1.year
=> 31557600.0
[9] pry(main)> 31557600.0.class
=> Float
[10] pry(main)> rand(31557600.0)
=> 22083830
[11] pry(main)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment