Sha256: eec6f4936191855fa196eb3b5105e75036aefdcd797920eae8cfc3c8abb7e303
Contents?: true
Size: 274 Bytes
Versions: 17
Compression:
Stored size: 274 Bytes
Contents
class Trophy < ActiveRecord::Base attr_accessible :generic_file_id, :user_id 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
17 entries across 17 versions & 2 rubygems