aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/cast.rb
blob: 5b3e88fb0843f951c6d891d34065cc7c221ad1b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
module ActiveRecord
  module ConnectionAdapters
    module PostgreSQL
      module Cast # :nodoc:
        def range_to_string(object) # :nodoc:
          from = object.begin.respond_to?(:infinite?) && object.begin.infinite? ? '' : object.begin
          to   = object.end.respond_to?(:infinite?) && object.end.infinite? ? '' : object.end
          "[#{from},#{to}#{object.exclude_end? ? ')' : ']'}"
        end
      end
    end
  end
end