porkchopclub/porkchop

View on GitHub
app/models/stats/streak.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Stats
  class Streak < ActiveRecord::Base
    belongs_to :player
    validates :streak_type, :streak_length, presence: true
    validates :streak_type, inclusion: { in: %w(W L) }

    scope :active, -> { where finished_at: nil }
  end
end