Created
July 13, 2009 22:33
-
-
Save fsvehla/146501 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 ContactMail < ActiveRecord::Base | |
| has_no_table | |
| column :name, :string | |
| column :number, :string | |
| column :email_address, :string | |
| column :text, :string | |
| validates_presence_of :name, | |
| :message => 'Bitte geben Sie einen Namen an' | |
| validates_presence_of :text, | |
| :message => 'Bitte geben Sie einen Text an' | |
| def validate | |
| errors.add(:number, 'Bitte geben Sie entweder eine Telefonnummer oder E-Mail-Addresse ein.') if number.blank? && email_address.blank? | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment