Class: Trophy
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Trophy
- Defined in:
- app/models/trophy.rb
Instance Method Summary collapse
Instance Method Details
#count_within_limit ⇒ Object
6 7 8 9 10 |
# File 'app/models/trophy.rb', line 6 def count_within_limit if Trophy.where(user_id:self.user_id).count >= 5 errors.add(:base, "Exceeded trophy limit") end end |