Flowdock
method

new_column_from_field

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: SchemaStatements
new_column_from_field(table_name, field) private

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/sqlite3/schema_statements.rb, line 63
          def new_column_from_field(table_name, field)
            default =                case field["dflt_value"]
              when /^null$/
                nil
              when /^'(.*)'$/
                $1.gsub("''", "'")
              when /^"(.*)"$/
                $1.gsub('""', '"')
              else
                field["dflt_value"]
              end

            type_metadata = fetch_type_metadata(field["type"])
            Column.new(field["name"], default, type_metadata, field["notnull"].to_i == 0, table_name, nil, field["collation"])
          end
Register or log in to add new notes.