module ActiveSupport::CoreExtensions::Range::Conversions

def self.included(base) #:nodoc:

:nodoc:
def self.included(base) #:nodoc:
  base.class_eval do
    alias_method :to_default_s, :to_s
    alias_method :to_s, :to_formatted_s
  end
end

def to_formatted_s(format = :default)

[1..100].to_formatted_s # => "1..100"

==== Example

Gives a human readable format of the range.
def to_formatted_s(format = :default)
  RANGE_FORMATS[format] ? RANGE_FORMATS[format].call(first, last) : to_default_s
end