Sha256: 70ee54b6f479975e922a9475aae9fd640a1c02d7bb4c91c2875c1782a1c211d0
Contents?: true
Size: 246 Bytes
Versions: 29
Compression:
Stored size: 246 Bytes
Contents
# frozen_string_literal: true class Trophy < ActiveRecord::Base validate :count_within_limit, on: :create def count_within_limit return if Trophy.where(user_id: user_id).count < 5 errors.add(:base, "Exceeded trophy limit") end end
Version data entries
29 entries across 29 versions & 1 rubygems