instance method columns

Ruby on Rails 4.0.13

Since v4.0.13 Last seen in v4.1.16

Available in: v4.0.13 v4.1.16

Signature

columns(table_name)

Returns the list of all column definitions for a table.

Parameters

table_name req
Source
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb, line 185
        def columns(table_name)
          # Limit, precision, and scale are all handled by the superclass.
          column_definitions(table_name).map do |column_name, type, default, notnull, oid, fmod|
            oid = get_oid_type(oid.to_i, fmod.to_i, column_name)
            PostgreSQLColumn.new(column_name, default, oid, type, notnull == 'f')
          end
        end

Defined in activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb line 185 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::SchemaStatements

Type at least 2 characters to search.

↑↓ navigate · open · esc close