Class: ActiveRecord::ConnectionAdapters::ColumnDefinition
- 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.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#after ⇒ Object
Returns the value of attribute after.
-
#default ⇒ Object
Returns the value of attribute default.
-
#first ⇒ Object
Returns the value of attribute first.
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#name ⇒ Object
Returns the value of attribute name.
-
#null ⇒ Object
Returns the value of attribute null.
-
#precision ⇒ Object
Returns the value of attribute precision.
-
#primary_key ⇒ Object
Returns the value of attribute primary_key.
-
#scale ⇒ Object
Returns the value of attribute scale.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Methods inherited from Struct
Instance Attribute Details
#after ⇒ Object
Returns the value of attribute after
18 19 20 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 18 def after @after end |
#default ⇒ Object
Returns the value of attribute default
18 19 20 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 18 def default @default end |
#first ⇒ Object
Returns the value of attribute first
18 19 20 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 18 def first @first end |
#limit ⇒ Object
Returns the value of attribute limit
18 19 20 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 18 def limit @limit end |
#name ⇒ Object
Returns the value of attribute name
18 19 20 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 18 def name @name end |
#null ⇒ Object
Returns the value of attribute null
18 19 20 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 18 def null @null end |
#precision ⇒ Object
Returns the value of attribute precision
18 19 20 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 18 def precision @precision end |
#primary_key ⇒ Object
Returns the value of attribute primary_key
18 19 20 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 18 def primary_key @primary_key end |
#scale ⇒ Object
Returns the value of attribute scale
18 19 20 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 18 def scale @scale end |
#type ⇒ Object
Returns the value of attribute type
18 19 20 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 18 def type @type end |
Instance Method Details
#primary_key? ⇒ Boolean
23 24 25 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 23 def primary_key? primary_key || type.to_sym == :primary_key end |
#string_to_binary(value) ⇒ Object
19 20 21 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 19 def string_to_binary(value) value end |