123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::ConnectionAdapters::ColumnDefinition

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ::Struct
Instance Chain:
self, ::Struct
Inherits: Struct
Defined in: activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb

Overview

Abstract representation of a column definition. Instances of this type are typically created by methods in TableDefinition, and added to the columns attribute of said TableDefinition object, in order to be used for generating a number of table creation or table changing SQL statements.

Instance Attribute Summary

  • #primary_key? ⇒ Boolean readonly
  • #name rw Internal use only

    Abstract representation of a column definition.

  • #options rw Internal use only

    Abstract representation of a column definition.

  • #sql_type rw Internal use only

    Abstract representation of a column definition.

  • #type rw Internal use only

    Abstract representation of a column definition.

Instance Method Summary

Instance Attribute Details

#name (rw)

This method is for internal use only.

Abstract representation of a column definition. Instances of this type are typically created by methods in TableDefinition, and added to the columns attribute of said TableDefinition object, in order to be used for generating a number of table creation or table changing SQL statements.

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 79

ColumnDefinition = Struct.new(:name, :type, :options, :sql_type)

#options (rw)

This method is for internal use only.

Abstract representation of a column definition. Instances of this type are typically created by methods in TableDefinition, and added to the columns attribute of said TableDefinition object, in order to be used for generating a number of table creation or table changing SQL statements.

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 79

ColumnDefinition = Struct.new(:name, :type, :options, :sql_type)

#primary_key?Boolean (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 93

def primary_key?
  options[:primary_key]
end

#sql_type (rw)

This method is for internal use only.

Abstract representation of a column definition. Instances of this type are typically created by methods in TableDefinition, and added to the columns attribute of said TableDefinition object, in order to be used for generating a number of table creation or table changing SQL statements.

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 79

ColumnDefinition = Struct.new(:name, :type, :options, :sql_type)

#type (rw)

This method is for internal use only.

Abstract representation of a column definition. Instances of this type are typically created by methods in TableDefinition, and added to the columns attribute of said TableDefinition object, in order to be used for generating a number of table creation or table changing SQL statements.

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 79

ColumnDefinition = Struct.new(:name, :type, :options, :sql_type)

Instance Method Details

#aliased_types(name, fallback)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 109

def aliased_types(name, fallback)
  "timestamp" == name ? :datetime : fallback
end