lib/sportdb/formats/structs/team.rb in sportdb-formats-1.0.1 vs lib/sportdb/formats/structs/team.rb in sportdb-formats-1.0.2

- old
+ new

@@ -19,9 +19,16 @@ def names ## todo/check: add alt_names_auto too? - why? why not? [@name] + @alt_names end ## all names + def key + ## note: auto-generate key "on-the-fly" if missing for now - why? why not? + ## note: quick hack - auto-generate key, that is, remove all non-ascii chars and downcase + @key || @name.downcase.gsub( /[^a-z]/, '' ) + end + + ## special import only attribs attr_accessor :alt_names_auto ## auto-generated alt names attr_accessor :wikipedia # wikipedia page name (for english (en))