lib/sportdb/formats/structs/team.rb in sportdb-formats-1.1.2 vs lib/sportdb/formats/structs/team.rb in sportdb-formats-1.1.3
- old
+ new
@@ -63,9 +63,16 @@
@alt_names = kwargs[:alt_names] if kwargs.has_key? :alt_names
self ## note - MUST return self for chaining
end
+ ## add convenience lookup helper / method for name by season for now
+ ## use clubs history - for now kept separate from struct - why? why not?
+ def name_by_season( season )
+ ## note: returns / fallback to "regular" name if no records found in history
+ SportDb::Import.catalog.clubs_history.find_name_by( name: name, season: season ) || name
+ end
+
## helper methods for import only
## check for duplicates
include NameHelper
def duplicates?