lib/active_record/connection_adapters/redshift_adapter.rb
def extract_value_from_default(default) # :nodoc:
          case default
            # Quoted types
            when /\A[\(B]?'(.*)'::/m
              $1.gsub(/''/, "'")
            # Boolean types
            when 'true', 'false'
              default
            # Numeric types
            when /\A\(?(-?\d+(\.\d*)?)\)?\z/
              $1
            # Object identifier types
            when /\A-?\d+\z/
              $1
            else
              # Anything else is blank, some user type, or some function
              # and we can't know the value of that, so return nil.
              nil
          end
        end
# Extracts the value from a PostgreSQL column default definition.
Extracts the value from a PostgreSQL column default definition.
Extracts the value from a PostgreSQL column default definition .
def extract_value_from_default(default) 
          case default
            when /\A[\(B]?'(.*)'::/m
              $1.gsub(/''/, "'")
            when 'true', 'false'
              default
            when /\A\(?(-?\d+(\.\d*)?)\)?\z/
              $1
            when /\A-?\d+\z/
              $1
            else
              nil
          end
        end
def extract_value_from_default ( default ) case default when / \A [ \( B]?'(.*)':: /m $1 . gsub ( / '' / , "'" ) when 'true' , 'false' default when / \A \( ?(-? \d +( \. \d *)?) \) ? \z / $1 when / \A -? \d + \z / $1 else nil end end
Extracts the value from a PostgreSQL column default definition.
Extracts the value from a PostgreSQL column default definition .
# :nodoc: # Quoted types # Boolean types # Numeric types # Object identifier types # Anything else is blank, some user type, or some function # and we can't know the value of that, so return nil.
default