Showing
1 changed file
with
2 additions
and
2 deletions
... | @@ -2,8 +2,8 @@ class Match < ApplicationRecord | ... | @@ -2,8 +2,8 @@ class Match < ApplicationRecord |
2 | 2 | ||
3 | belongs_to :pool, inverse_of: :matches | 3 | belongs_to :pool, inverse_of: :matches |
4 | has_many :bets, dependent: :destroy, inverse_of: :match | 4 | has_many :bets, dependent: :destroy, inverse_of: :match |
5 | - validates :home, :away, :date, :pool, presence: true | 5 | + validates :visit, :local, :date, :pool, presence: true |
6 | - enum result: [:home, :tie, :away] | 6 | + enum result: [:visit, :tie, :local] |
7 | 7 | ||
8 | scope :active, -> { joins(:pool).where(pools: { active: true}) } | 8 | scope :active, -> { joins(:pool).where(pools: { active: true}) } |
9 | scope :upcoming, -> { active.where('date > ?', Time.zone.now) } | 9 | scope :upcoming, -> { active.where('date > ?', Time.zone.now) } | ... | ... |
-
Please register or login to post a comment