Class: ActiveRecord::ConnectionAdapters::PostgreSQLColumn

Inherits:
Column
  • Object
show all
Defined in:
activerecord/lib/active_record/connection_adapters/postgresql/column.rb

Overview

PostgreSQL-specific extensions to column definitions in a table.

Instance Attribute Summary

Attributes inherited from Column

#collation, #comment, #default, #default_function, #name, #null, #sql_type_metadata, #table_name

Instance Method Summary collapse

Methods inherited from Column

#==, #bigint?, #has_default?, #hash, #human_name, #initialize

Constructor Details

This class inherits a constructor from ActiveRecord::ConnectionAdapters::Column

Instance Method Details

#serial?Boolean


8
9
10
11
12
# File 'activerecord/lib/active_record/connection_adapters/postgresql/column.rb', line 8

def serial?
  return unless default_function

  %r{\Anextval\('"?#{table_name}_#{name}_seq"?'::regclass\)\z} === default_function
end