Where is the best place to add a method to the integer class in Rails?
I\'d like to add a to_meters
and to_miles
methods.
I agree monkey patching should be used with care, but occasionally it just make sense. I really like the helpers that allow you to type 5.days.ago which are part of the active_support library
So some of the other answers might be better in this case, but if you are extending ruby classes we keep all our extensions in lib/extensions/class_name.rb
this way when working on a project it is quick and easy to find and see anything that might be out of the ordinary with standard classes.