Class: ActiveRecord::ConnectionAdapters::ColumnDefinition

Inherits:
Struct
  • Object
show all
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 collapse

Instance Method Summary collapse

Methods inherited from Struct

#as_json

Instance Attribute Details

#afterObject

Returns the value of attribute after


13
14
15
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 13

def after
  @after
end

#auto_incrementObject

Returns the value of attribute auto_increment


13
14
15
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 13

def auto_increment
  @auto_increment
end

#collationObject

Returns the value of attribute collation


13
14
15
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 13

def collation
  @collation
end

#commentObject

Returns the value of attribute comment


13
14
15
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 13

def comment
  @comment
end

#defaultObject

Returns the value of attribute default


13
14
15
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 13

def default
  @default
end

#firstObject

Returns the value of attribute first


13
14
15
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 13

def first
  @first
end

#limitObject

Returns the value of attribute limit


13
14
15
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 13

def limit
  @limit
end

#nameObject

Returns the value of attribute name


13
14
15
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 13

def name
  @name
end

#nullObject

Returns the value of attribute null


13
14
15
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 13

def null
  @null
end

#precisionObject

Returns the value of attribute precision


13
14
15
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 13

def precision
  @precision
end

#primary_keyObject

Returns the value of attribute primary_key


13
14
15
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 13

def primary_key
  @primary_key
end

#scaleObject

Returns the value of attribute scale


13
14
15
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 13

def scale
  @scale
end

#sql_typeObject

Returns the value of attribute sql_type


13
14
15
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 13

def sql_type
  @sql_type
end

#typeObject

Returns the value of attribute type


13
14
15
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 13

def type
  @type
end

Instance Method Details

#primary_key?Boolean


15
16
17
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 15

def primary_key?
  primary_key || type.to_sym == :primary_key
end