method

new_column_definition

Importance_0
v4.0.2 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters::TableDefinition
new_column_definition(name, type, options) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 265
      def new_column_definition(name, type, options) # :nodoc:
        column = create_column_definition name, type
        limit = options.fetch(:limit) do
          native[type][:limit] if native[type].is_a?(Hash)
        end

        column.limit       = limit
        column.array       = options[:array] if column.respond_to?(:array)
        column.precision   = options[:precision]
        column.scale       = options[:scale]
        column.default     = options[:default]
        column.null        = options[:null]
        column.first       = options[:first]
        column.after       = options[:after]
        column.primary_key = type == :primary_key || options[:primary_key]
        column
      end
Register or log in to add new notes.