lib/scaffolding_extensions/model/sequel.rb
# Get the column type from the schema.  Sequel doesn't differentiate between string and
# text columns (since both are the same in ruby), so check if the database type is
# text or if more than 255 characters allowed in the field and return :text if the type
# is string.
Get the column type from the schema.  Sequel doesn't differentiate between string and
text columns (since both are the same in ruby), so check if the database type is
text or if more than 255 characters allowed in the field and return :text if the type
is string.
Get the column type from the schema . Sequel doesn ' t differentiate between string and text columns ( since both are the same in ruby ) so check if the database type is text or if more than 255 characters allowed in the field and return : text if the type is string .
def scaffold_table_column_type(column)
    if String === column
      return nil unless columns.map{|x| x.to_s}.include?(column)
      column = column.to_sym
    end
    if column_info = db_schema[column] and type = column_info[:type]
      if type == :string && (column_info[:db_type] == "text" || ((mc = column_info[:max_chars]) && mc > 255))
        :text
      else
        type
      end
    end
  end
def scaffold_table_column_type ( column ) if String === column return nil unless columns . map { | x | x . to_s } . include? ( column ) column = column . to_sym end if column_info = db_schema [ column ] and type = column_info [ :type ] if type == :string && ( column_info [ :db_type ] == "text" || ( ( mc = column_info [ :max_chars ] ) && mc > 255 ) ) :text else type end end end
Get the column type from the schema.
Get the column type from the schema .
column
<not_specific>