mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 22:15:14 +00:00
8 lines
306 B
Ruby
8 lines
306 B
Ruby
class LeaderboardEntry < ApplicationRecord
|
|
belongs_to :leaderboard
|
|
belongs_to :user, primary_key: :slack_uid
|
|
|
|
validates :user_id, presence: true
|
|
validates :total_seconds, presence: true, numericality: { greater_than_or_equal_to: 0 }
|
|
validates :user_id, uniqueness: { scope: :leaderboard_id }
|
|
end
|