Tagged as human_name

edit delete favorite
Posted by kylejginavan on Nov 01, 2007
This two little nuggets does the inverse of column.human_name and gives you the data type if you have the human name and not column object.
def self.get_column_name(column_name)
  return column_name.downcase.gsub(/ /,'_')
end 
  
def self.get_column_type(column_name)
  for column in Object.content_columns 
    if column.name == get_column_name(column_name)
      return column.klass
    end
  end
end
 
Please submit any bugs/features and report abuse. Thanks!
Spacer
Spacer
Spacer
Top Tags
Spacer