Tuesday, June 30, 2015

how to use active support outside of rails

Error : NoMethodError: undefined method `hours' for 1:Fixnum

Resolution:

1. bundle open activesupport
2. Search for 'def hours', it is found in core_ext/numeric/time.rb
3. Add require 'active_support/core_ext/numberic/time.rb'

This is better than doing : require 'active_support/all'