public
Created — forked from TorD/gist:1869279

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
def get_field_type_for(kind)
 
types = {
"nr" => "number",
"tlf" => "number",
"telefon" => "number",
"nummer" => "number",
"merknad" => "text",
"notater" => "text",
"anmerkning" => "text"
}
 
types[kind.to_s.downcase] || "string"
 
end

mini-performance boost by not using types.default (hat tip @hakon)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.