Class: ActiveRecord::ConnectionAdapters::ColumnDefinition
- Inherits:
-
Struct
- Object
- Struct
- ActiveRecord::ConnectionAdapters::ColumnDefinition
- Defined in:
- lib/active_record/connection_adapters/abstract/schema_definitions.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
-
#default ⇒ Object
Returns the value of attribute default.
-
#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.
-
#scale ⇒ Object
Returns the value of attribute scale.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #sql_type ⇒ Object
- #to_sql ⇒ Object (also: #to_s)
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base
205 206 207 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 205 def base @base end |
#default ⇒ Object
Returns the value of attribute default
205 206 207 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 205 def default @default end |
#limit ⇒ Object
Returns the value of attribute limit
205 206 207 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 205 def limit @limit end |
#name ⇒ Object
Returns the value of attribute name
205 206 207 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 205 def name @name end |
#null ⇒ Object
Returns the value of attribute null
205 206 207 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 205 def null @null end |
#precision ⇒ Object
Returns the value of attribute precision
205 206 207 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 205 def precision @precision end |
#scale ⇒ Object
Returns the value of attribute scale
205 206 207 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 205 def scale @scale end |
#type ⇒ Object
Returns the value of attribute type
205 206 207 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 205 def type @type end |
Instance Method Details
#sql_type ⇒ Object
207 208 209 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 207 def sql_type base.type_to_sql(type.to_sym, limit, precision, scale) rescue type end |
#to_sql ⇒ Object Also known as: to_s
211 212 213 214 215 |
# File 'lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 211 def to_sql column_sql = "#{base.quote_column_name(name)} #{sql_type}" (column_sql, :null => null, :default => default) unless type.to_sym == :primary_key column_sql end |