Sha256: 017e2ee1bea1723ced3cfa8bd4446903faf4b05a03a29ef33f5e74793ccd723e
Contents?: true
Size: 304 Bytes
Versions: 10
Compression:
Stored size: 304 Bytes
Contents
class Trophy < ActiveRecord::Base attr_accessible :generic_file_id, :user_id if Rails::VERSION::MAJOR == 3 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