lib/sportdb/models/event.rb in sportdb-models-1.18.1 vs lib/sportdb/models/event.rb in sportdb-models-1.18.2

- old
+ new

@@ -13,10 +13,11 @@ has_many :groups, order: 'pos' else has_many :rounds, -> { order('pos') } # all (fix and flex) rounds has_many :groups, -> { order('pos') } end + has_many :stages has_many :games, :through => :rounds has_many :event_teams, class_name: 'EventTeam' has_many :teams, :through => :event_teams @@ -38,10 +39,10 @@ def on_before_save # event key is composite of league + season (e.g. at.2012/13) etc. self.key = "#{league.key}.#{season.key}" end - + def title "#{league.title} #{season.title}" end