Parent

Files

Class/Module Index [+]

Quicksearch

ActiveRecord::ConnectionAdapters::Mysql2Column

Constants

BOOL

Public Instance Methods

extract_default(default) click to toggle source
# File lib/active_record/connection_adapters/mysql2_adapter.rb, line 27
def extract_default(default)
  if sql_type =~ /blob/ || type == :text
    if default.blank?
      return null ? nil : ''
    else
      raise ArgumentError, "#{type} columns cannot have a default value: #{default.inspect}"
    end
  elsif missing_default_forged_as_empty_string?(default)
    nil
  else
    super
  end
end
has_default?() click to toggle source
# File lib/active_record/connection_adapters/mysql2_adapter.rb, line 41
def has_default?
  return false if sql_type =~ /blob/ || type == :text #mysql forbids defaults on blob and text columns
  super
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.