paul / progress_bar

A Ruby terminal progress_bar
Do What The F*ck You Want To Public License
623 stars 49 forks source link

Fixes undefined method error when using progress_bar in Rails 4. #21

Closed fivedigit closed 10 years ago

fivedigit commented 11 years ago

Not sure why, but after upgrading to Rails 4 this issue started. Now it explicitly loads the Time class form the default module to fix this issue, figured this change wouldn't hurt anyway.

undefined method `at' for ProgressBar::Time:Class
progress_bar-1.0.0/lib/progress_bar.rb:18:in `initialize'
paul commented 11 years ago

Interesting, I've never run into this issue before, even with Rails 4. What happens if instead you explicitly require "time" instead?

fivedigit commented 11 years ago

An explicit require 'active_support/core_ext/numeric/time.rb' works, though Rails should already be loading these extensions.