Created
April 29, 2009 16:01
-
-
Save neaf/103865 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Match < Sequel::Model | |
| validates do | |
| presence_of :first_player_id | |
| presence_of :second_player_id | |
| presence_of :happens_at | |
| presence_of :sport_id | |
| end | |
| def validate | |
| super | |
| errors.add(:second_player_id, 'Selected teams have to be different.') if first_player_id == second_player_id | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment