Sha256: c7741578958950d2e461f66f9d8722573fcd5226d416e2985293cbfcf007b690
Contents?: true
Size: 228 Bytes
Versions: 10
Compression:
Stored size: 228 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
10 entries across 10 versions & 2 rubygems