26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/ruby-opengeodb/location.rb', line 26
def type_id(type)
case type
when :postleitzahl,:plz
typename = Typename.find(:first, :conditions => "name = 'Postleitzahl' AND type_locale = 'de'")
when :postleitzahlgebiet
typename = Typename.find(:first, :conditions => "name = 'Postleitzahlgebiet' AND type_locale = 'de'")
when :kfz_kennzeichen
typename = Typename.find(:first, :conditions => "name = 'KFZ-Kennzeichen' AND type_locale = 'de'")
when :kanton
typename = Typename.find(:first, :conditions => "name = 'Kanton' AND type_locale = 'de_CH'")
when :ortsname
typename = Typename.find(:first, :conditions => "name = 'Name' AND type_locale = 'de'")
else
raise 'invalid type: '+type.to_s
end
return typename.attributes['type_id']
end
|