instance method columns

Ruby on Rails 4.2.9

Since v4.2.9 Last seen in v4.2.9

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 195
        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, type)
            default_value = extract_value_from_default(oid, default)
            default_function = extract_default_function(default_value, default)
            new_column(column_name, default_value, oid, type, notnull == 'f', default_function)
          end
        end

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

Defined in ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements

Type at least 2 characters to search.

↑↓ navigate · open · esc close