Sha256: 55be94997909a54672b592c0c6c66573408697cf8c8b15b16b47d01d2fba838d
Contents?: true
Size: 225 Bytes
Versions: 37
Compression:
Stored size: 225 Bytes
Contents
class Trophy < ActiveRecord::Base validate :count_within_limit, on: :create def count_within_limit if Trophy.where(user_id:self.user_id).count >= 5 errors.add(:base, "Exceeded trophy limit") end end end
Version data entries
37 entries across 37 versions & 2 rubygems