aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/column.rb
blob: 0eb4fb468cb3850f2226f7b8ea757fef7a36cb7e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
module ActiveRecord
  module ConnectionAdapters
    # PostgreSQL-specific extensions to column definitions in a table.
    class PostgreSQLColumn < Column #:nodoc:
      delegate :array, :oid, :fmod, to: :sql_type_metadata
      alias :array? :array

      def serial?
        default_function && default_function =~ /\Anextval\(.*\)\z/
      end
    end
  end
end