Class: ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::TableDefinition
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::TableDefinition
- Defined in:
- lib/activerecord-mysql-unsigned/active_record/v3/connection_adapters/abstract_mysql_adapter.rb
Instance Method Summary collapse
-
#initialize(base) ⇒ TableDefinition
constructor
A new instance of TableDefinition.
-
#new_column_definition(name, type, options) ⇒ Object
:nodoc:.
Constructor Details
#initialize(base) ⇒ TableDefinition
Returns a new instance of TableDefinition.
8 9 10 |
# File 'lib/activerecord-mysql-unsigned/active_record/v3/connection_adapters/abstract_mysql_adapter.rb', line 8 def initialize(base) @base = base end |
Instance Method Details
#new_column_definition(name, type, options) ⇒ Object
:nodoc:
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/activerecord-mysql-unsigned/active_record/v3/connection_adapters/abstract_mysql_adapter.rb', line 12 def new_column_definition(name, type, ) # :nodoc: column = create_column_definition name, type limit = .fetch(:limit) do native[type][:limit] if native[type].is_a?(Hash) end column.limit = limit column.precision = [:precision] column.scale = [:scale] column.unsigned = [:unsigned] column.default = [:default] column.null = [:null] column.first = [:first] column.after = [:after] column end |